![]() |
[How To] Automated bash cron backup.
Originally a question, figured it out, thought I'd share.
To automatically make a backup of your database using cron: Code:
#! /bin/bash
With the proper information. Note that there is no space between -pPassword, it's intentional. Then replace "/path/to/backups/" with the actual path that you want to put them in. Make sure the directory exists. Put the backup.sh file in the appropriate cron folder. I'm running mine weekly, so mine is in /etc/cron.weekly/. CHMOD it +x (chmod +x backup.sh) Output of it is a database file, named (the date).sql. Putting it in cron.weekly will run it every Sunday night at Midnight, and give you a file that looks like this: Code:
[cron.weekly]# sh backup.sh |
Just want to throw this one and only bump.
If you're a geek such as myself and have FTP access out from work (and a decent connection) you can setup a cron job there to download 'em automatically as well. Peace of mind. :) |
All times are GMT. The time now is 09:27 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|