Hi
I currently have Simple backup doing my backups for me. It backs up to a folder say sdb1/backups . I have made a basic alias that I can type at the command line which copies the sdb1/backups contents to an external hard drive /500gb/backups. The alias copies across all the new backups and updates existing copies if they have changed.
Simple backup is doing the logarithmic backup where it keeps 1 backup from today, 1 from yesterday, 1 from last week and so on. Simple backup does it's own deleting to keep things tidy which is my issue. While my alias copies all the new stuff across to the second backup area it doesn't delete the files that the originating backups folder no longer has. I'm not really sure how to get the second backup folder to dispose of these files. I'm going to change from the alias to a basic script that will run from cron.
I am wondering how to compare the source folder of backups to the secondary backups and keep them in line. I think I need to pipe a list from the source folder into grep -v or something and then remove the difference.
Any ideas ?
Backup issue.
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
Backup issue.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Backup issue.
I don't remember the specific option off the top of my head, but rsync can synchronize two folders and delete the excessive files in the destination folder (i.e. the ones that don't exist in the source folder any more).
Check out the man page and/or Google for "rsync examples", if you cannot find what you need I can doublecheck for you.
Check out the man page and/or Google for "rsync examples", if you cannot find what you need I can doublecheck for you.
Re: Backup issue.
Thanks Marios. I will have a look and ask a bit more if I get stuck. Between google and man
pages I normally figure most things out.
pages I normally figure most things out.
Re: Backup issue.
I think what you want isthe -av is the most popular option, --delete keeps them identical.
If you want to do a dry run and see what it will do without making any changes use the -n is the dry run switch.
will give you much more info.
Code: Select all
rsync -av --delete
If you want to do a dry run and see what it will do without making any changes use
Code: Select all
rsync -avn --delete
Code: Select all
man rsync