Topic: How to automatically back up database daily?

Hi all,

I'm finding backing up of the database useful specially when everything went wrong when I tried to upgrade my version. However, it's not everyday that there is someone available to back up the database.

Is there a way to make the back up process automated daily?

Re: How to automatically back up database daily?

Not from within FA itself, but you can have a cron job (or a "scheduled task" if you're on Windows) do it easily enough.

Below is what I run on a Linux server.

#!/bin/bash
url="http://hostname.domain.tld/"
cd "$(dirname "$0")"

curl -s -c my_session -F 'user_name_entry_field=backup' \
                      -F 'password=secretpassword' \
                      -F 'company_login_name=0' ${url} >/dev/null

curl -s -b my_session -F 'creat=Create Backup' ${url}admin/backups.php \
     | hxnormalize -l 240 -x | hxselect -s '\n' -c '#msgbox' | hxselect -c div 
echo
rm my_session

The script uses curl to log in as user "backup" with password "secretpassword" and "clicks" the "create backup" button for you. The "hx" stuff is there to select out the interesting parts (success/failure status messages) from the server response. Just remove that line if you don't want it.