Jailer
Not strong, but bad
- Joined
- Sep 12, 2014
- Messages
- 4,977
I'm looking for someone to help me with the correct syntax to set up an rsync task to archive the contents of a folder, add the date to the file name and move it to another location. I've been searching on google so much for the last 3 days my head is starting to spin.
What I'm trying to do is backup 2 directories in a jail to another dataset. I've already set up a daily sync task that is working just fine using the command below:
What I'm having trouble with is setting up a second task to run weekly that will take the contents of the sync'd directory above named "daily" and zip them up in an archive with the date included in the file name and move them to the directory /mnt/RAIDZ2_1/forumbackup/archive so that it doesn't get overwritten every week when the task runs. If that's not possible is it possible to move them to a new directory with the date on a weekly schedule? Either way would work for me, I just want to automate it so I don't have to babysit it and do it manually. I figure I can prune the old files manually on occasion as needed.
Can someone please help me with this?
Thanks.
What I'm trying to do is backup 2 directories in a jail to another dataset. I've already set up a daily sync task that is working just fine using the command below:
Code:
rsync -av --delete /mnt/RAIDZ2_1/jails/phpbb3013/usr/local/www/nginx/phpBB3 /mnt/RAIDZ2_1/forumbackup/daily rsync -av --delete /mnt/RAIDZ2_1/jails/phpbb3013/var/db/mysql /mnt/RAIDZ2_1/forumbackup/daily
What I'm having trouble with is setting up a second task to run weekly that will take the contents of the sync'd directory above named "daily" and zip them up in an archive with the date included in the file name and move them to the directory /mnt/RAIDZ2_1/forumbackup/archive so that it doesn't get overwritten every week when the task runs. If that's not possible is it possible to move them to a new directory with the date on a weekly schedule? Either way would work for me, I just want to automate it so I don't have to babysit it and do it manually. I figure I can prune the old files manually on occasion as needed.
Can someone please help me with this?
Thanks.