Cron script to backup /var/lib/asterisk/backups/Daily - Please help

jlobe
Posts: 41
Member Since:
2008-10-08

I have been trying to work with setting up a cron script to automatically send the contents of the Daily backups folder to my FTP server. I cannot use the trixbox module backup because I have read about all the bugs it contains, nor can I use the FTP backup in amportal.conf because for some reason it doesn't work on my newer setups. I used this website to set up the FTP backup:

http://bunkerhollow.com/blogs/matt/archive/2008/06/04/backup-trix...

I got up to the part where it gives me a cron script to backup weekly. I dont want to backup weekly, I want to backup nightly and I want to specify a time.
Here is the original script that needs to be added to /etc/crontab

01 0 * * 1 root /usr/local/sbin/ftpbackup

"This will run the script at 12:01am every Monday morning."
This is what I want to change, I need the times different depending on the machine so that I don't congest my FTP server with a few servers sending their stuff to me all at once. As well, I would like to set this to the "daily" mode instead of the "weekly" mode

This part isn't a major but it would be nice to have. This script will delete the backed up file Monday at 1:01 am. It would be nice to know how to change that to something like 7 am daily- even during the day wouldnt be a problem as it will not interfere with asterisk

01 1 * * root rm -f /var/lib/asterisk/backups/Weekly/*

Thanks in advance for all help



kb9mwr
Posts: 166
Member Since:
2006-09-09
Google "crontab examples"

* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)



bmccall
Posts: 3
Member Since:
2007-09-23
Try using this cron script.

Try using this cron script. This will allow it to be backed up daily at 12:01 AM. To change the time of day just change the first 2 sets of numbers following what kb9mwr said.

01 0 * * * root /usr/local/sbin/ftpbackup



jlobe
Posts: 41
Member Since:
2008-10-08
Works great bmccall and

Works great
bmccall and kb9mwr, thanks for all your help
I got it to work with the help or both of your instructions



jahyde
Posts: 2002
Member Since:
2006-06-02
look for the ftp option in

look for the ftp option in /etc/amportal.conf

--

--my PBX is run on 2 V8's



jlobe
Posts: 41
Member Since:
2008-10-08
jlobe wrote: nor can I use
jlobe wrote:
nor can I use the FTP backup in amportal.conf because for some reason it doesn't work on my newer setups

Anyways the google instructions worked. Thanks so much



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.