daily backup script?
Moderator: Moderators
daily backup script?
I did some searching but the search function ignores the word "script" so nothing came up. Is there a handy script/cron already written to make a backup every x hours and save to an attached USB drive? I assume this would occur in crontab, but I'm mostly familiar with Debian and router command line structure is a bit foreign to me.
Re: daily backup script?
What do you want to backup?
There are backup scripts for BW and Quota data already written that write to /usr/data and /tmp/data, which would be a great template to start.
Do you want to backup the entire configuration? There's a script for that too which could be used as a base.
There are backup scripts for BW and Quota data already written that write to /usr/data and /tmp/data, which would be a great template to start.
Do you want to backup the entire configuration? There's a script for that too which could be used as a base.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: daily backup script?
Entire configuration
Re: daily backup script?
Use the existing script
https://github.com/ericpaulbishop/gargo ... _backup.sh
Then download/transfer the file from /tmp/backup/backup.tar.gz and delete it after.
https://github.com/ericpaulbishop/gargo ... _backup.sh
Code: Select all
sh /usr/lib/gargoyle/create_backup.sh
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.
Re: daily backup script?
OK, so what I would do is edit the root crontab to execute that default script every x amount of time.
But I'll need to adjust the script to copy the backup file to the USB drive then rename it to include datetime in the filename.
Can you give me some hints on the syntax for that? Or a google search phrase that will get me started?
something like:
But I'll need to adjust the script to copy the backup file to the USB drive then rename it to include datetime in the filename.
Can you give me some hints on the syntax for that? Or a google search phrase that will get me started?
something like:
Code: Select all
mv /tmp/backup/backup.tar.gz /mnt/backup_$(date +"%FT%H%M".tar.gz
Re: daily backup script?
Yes something like that. I’d use
"$(date +%Y%m%d_%H%M%S)".tar.gz
Your usb drive should have a mount point under /tmp/usb_mount/ as well.
My advice is to not modify the original script as that is part of Gargoyle functionality.
Instead write another script called “mybackup.sh” that does 2 things:
1. Calls the gargoyle backup script
2. Moves the file to your usb drive
Then use cron to execute that one.
"$(date +%Y%m%d_%H%M%S)".tar.gz
Your usb drive should have a mount point under /tmp/usb_mount/ as well.
My advice is to not modify the original script as that is part of Gargoyle functionality.
Instead write another script called “mybackup.sh” that does 2 things:
1. Calls the gargoyle backup script
2. Moves the file to your usb drive
Then use cron to execute that one.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.
Please be respectful when posting. I do this in my free time on a volunteer basis.