I wrote a Backupscript for a friend of mine.
It backups pictures from a shared folder to his other 3 disks so he has 4 backups, just to be sure.
You can use it for other things, documents etc., too.
The script is configured to remove files, that were deleted on the source from all backups, except the first one.
The second script removes the deleted files on all backups!
backup.sh
Code
#! /bin/sh
# define source directory, e.g. your share!
source='/media/UUID/Pictures/'
# define target(s), comment uneeded targets out or add more if you want to have more
target1='/media/UUID/Pictures/'
target2='/media/UUID/Pictures/'
target3='/media/UUID/Pictures/'
#execute rsync backup - a log will be generated, deleted files will be removed
# from the backup, except the first target, just to be safe!
rsync -auv --log-file=/var/log/rsync_backup $source $target1
rsync -auv --log-file=/var/log/rsync_backup --delete $source $target2
rsync -auv --log-file=/var/log/rsync_backup --delete $source $target3
Alles anzeigen
removedeletedfiles.sh
Code
[code]
#! /bin/sh
# define source directory, e.g. your share!
source='/media/UUID/Pictures/'
# define target(s), comment uneeded targets out or add more if you want to have more
target1='/media/UUID/Pictures/'
target2='/media/UUID/Pictures/'
target3='/media/UUID/Pictures/'
#execute rsync backup - a log will be generated, deleted files will be removed
# from the backup, except the first target, just to be safe!
rsync -auv --log-file=/var/log/rsync_backup --delete $source $target1
rsync -auv --log-file=/var/log/rsync_backup --delete $source $target2
rsync -auv --log-file=/var/log/rsync_backup --delete $source $target3
Alles anzeigen
Greetings
David