I tried it but it didn't work
Here's the contents of backupstore.sh (are the permissions meant to be 512? x x x?)
PHP Code:
#!/bin/bash
#BackupStore.sh
#purpose to close the store and backup the database
echo "Closing up shop"
cat /home/7-letter-accountname-where-script-is/myscripts/htaccess-closed > /home/account-name-of-site/public_html/.htaccess
echo "Sleeping 10 seconds to let connections die"
sleep 10s
mysqldump --opt db-name -u username -p password > /home/account-to-save-to/public_html/folder1/dbbackup-$(date +%d).sql
sleep 3s
cat /home/7-letter-accountname-where-script-is/myscripts/htaccess-open > /home/account-name-of-site/public_html/.htaccess
Then I set up a cron in cpanel to run at 3.30am. Waited till then (ran the 'date' command to check time was right) but it didn't work (site was still 'on').
I tried it with '~' before the path in the 'cat' lines and without (as shown above). Do I need that btw? (I guessed it was to do with relative paths?)
Can anyone spot what I've done wrong? :-/