linus torvalds hates backups, he like everyone else, tends to not do them.

but if you feel your multiple wordpress installations should be backed up, in case some russian spam-hacker manages to completely compromise your site(s).

you can install this backup mechanism in 5 seconds:

automated backups once a week:

1. become root

 su

2. edit crontab file

crontab -e

3. add these two lines CHANGE THE PASSWORD TO YOUR MYSQL ROOT PASSWORD!

0 0 * * 0 mysqldump -u root --password=ajklsjkldjlk --all-databases > /var/$(date +%Y-%m-%d)_alldb.sql # backup complete mysql database once a week

0 0 * * 0 mysqldump -u root --password=ajklsjkldjlk --all-databases > /var/$(date +%Y-%m-%d)_alldb.sql # backup complete mysql database once a week
0 0 * * 0 tar fcvz /var/$(date +%Y-%m-%d)_www.tar.gz /var/www # backup all website-files

so it looks like this:

  GNU nano 2.2.4                                                            File: /tmp/crontab.DoadnH/crontab                                                                                                                     Modified

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
0 0 * * 0 mysqldump -u root --password=ajklsjkldjlk --all-databases > /var/$(date +%Y-%m-%d)_alldb.sql # backup complete mysql database once a week
0 0 * * 0 tar fcvz /var/$(date +%Y-%m-%d)_www.tar.gz /var/www # backup all website-files

and you are done.

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin