Forum Moderators: phranque
Any suggestions?
Assuming your server is a UNIX box, this command would work on the shell prompt:
cp -R /home/user/websitefolder /home/user/backup
Now, the trick is getting that to run automatically. To do that you set up a "cronjob". Ask your webhost how to do that.
You need to check this, but I think in essence it would be something like:-
#!/bin/shHOST='ftpmybackupserver.net'
USER='myUserid'
PASSWD='mypassword'
#Refresh our backup file
tar -cfu backup.tar <directory to backup>
#Optional : zip it up for later FTP-ing
gzip backup.tar
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put backup.tar.gz
quit
END_SCRIPT
exit 0
Call something like that from CRON as mentioned above.
You might then want another script on the FTP server receiving the files to rotate them, just in case you end up with a defective file for some reason (so you have several).
TJ