annotate backup-website-images @ 22:faa17dcc2c95

Make a compromise when backing up to external HDD Backups are getting bigger and space is getting short!
author IBBoard <dev@ibboard.co.uk>
date Sun, 09 Jun 2019 15:52:35 +0100
parents a6f490ec0c1c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 #! /bin/bash
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 dest=~/Websites/image-backup/
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 mkdir -p $dest
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5
21
a6f490ec0c1c Update website backup scripts to new sites
IBBoard <dev@ibboard.co.uk>
parents: 9
diff changeset
6 paths="bdstrike/content/uploads/
0
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 skins/images"
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 for path in $paths; do
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 dest_path=${dest}${path%/*}
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 mkdir -p $dest_path
9
a3c7051ceb21 Fix paths so rsync of images works
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
12 rsync -ravz -e "ssh -i /home/ibboard/.ssh/cron" vps:$path $dest_path >> /home/ibboard/cron.log 2>&1
0
e85e3470a41e Initial commit of useful scripts
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 done