While hosting debutsav.in, I came to a scenario to get regular backups of the registration db. This would be a regular requirement for anyone working with web, and cares about data security. I went through various blogs available – and let me share the one that helped me great 🙂
The key is to add a cronjob to the linux system – to automate the mailing part. To write the cron job.
# crontab -e
That would sometimes bring about a confirmation message, otherwise proceed to next step.
You will need a file
emailbody.txt that would contain the email body.
IMP: This would mail you the db backup every day at 12:00 am ( sometimes pm 😀 ).
0 0 * * * mutt -s "Database Backup" -a /path/to/sqlitedb.db -- firstname.lastname@example.org < /path/to/emailbody.txt
Save and close the file, and you are good to go 🙂
* What if your web hosting provider do not allow emails ?
> You can check that one by running this command:
$ mail email@example.com
enter a test subject and body – and click ‘.’ to finish of the email body and send the mail 🙂