How to Schedule Backups With a Cron Job
Hello, I need to schedule a daily backup with cronjob.
I have created file backup.sh with this content:
_________________________________________________________________________
#!/bin/sh
wget -O /dev/null -q –http-user=$1 –http-password=$2 [redacted] –post-data=”dest=homedir&email=$3&email_radio=1&user=$1&pass=$2″
_________________________________________________________________________
and a cronjob with this command:
lynx -dump -useragent=/home/myUserName/backup.sh “myUserName” “myPassword” “myEmailAddress”
I also tryed:
lynx -dump -useragent=lynx(/home/myUserName/backup.sh) myUserName myPassword myEmailAddress
I got an email on the corect time, with the following message:
_________________________________________________________________________
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `lynx -dump -useragent=lynx(/home/myUserName/backup.sh) myUserName myPassword myEmailAddress
_________________________________________________________________________
and an other one, with previus tests with the following message:
_________________________________________________________________________
Warning: User-Agent string does not contain "Lynx" or "L_y_n_x"!
Alert!: User-Agent string does not contain "Lynx" or "L_y_n_x"
Can't Access `file://localhost/home/myUserName/myEmailAddress
Alert!: Unable to access document.
lynx: Can't access startfile
_________________________________________________________________________
What is the correct syntax to make it work?
Thank you!
I am very concerned about hacking and want to backup my databases several times a day because they most probably will change many times in a day.
It seems that a cron job is the logical answer.
I cannot find a cron to do this AND it must not overwrite the previous cron as any corruption will be written into the new cron.
(I think that having the cron Email the databases to me would prevent overwriting)
I am open to any suggestions...including paying for the cron to be written.
Can anyone help and/or advise me?
Thank you
Jim MacLeod