Jump to content
  • Welcome Guest To Mopar1973Man.Com

    We are a Dodge Ram Cummins Turbo Diesel forum. We are very friendly and helpful group of Dodge Ram Cummins owners. We will try to keep your truck running the best we can and provide information for diagnostics, repairs and even guide you on the best replacement parts to use. 


    Registration is free. Registering on the site will provide access to many more things like...

    • Contribute to the Forum being able to ask questions and get support for your Dodge Ram Cummins.
    • Contribute to Article Database adding your ideas and suggestions.
    • Classified Ads posted by the members. Post up your used parts and vehicles.
    • Member Garage where you can proudly display your vehicles and modifications that you have done to them.
    • Download files, documents, and Quadzilla Adrenaline tunes for your truck.
    • 911 Support Network. We've got a group of members will to aid you if your truck breaks down on the road.
    • Reduced Advertisements displayed to you.

Sign in to follow this  

Lightning Fast Linux Web Server Backups!

Recommended Posts

With all the time I spend working on web servers I've found new ways of backing up files and MySQL databases fast so I don't have to download files across the Internet or FTP stuff back and forth.

So here is my BASH script...

#!/bin/bashcd ~/folder/forum/tar -zcvf forum-backup-$(date '+%m-%d-%Y').tar.gz ~/folder/forum/cd ~/folder/articles/tar -zcvf articles-backup-$(date '+%m-%d-%Y').tar.gz ~/folder/articles/
This little but effective script creates a TARball file similar to ZIP in Windows and the file name has a date stamp in it so if there is several backups made they are all dated.


Just for fun facts todays backup at 06/08/2012 is roughly 1.3 GB just for the forum alone! :stuned::wow:

The it switches directories and backs up the article files as well in the same manner.


But it allows me to back up the 2 big chunks of the site in less than about 10 minutes tops. :wink:

Same with the MySQL databases... :whistle:

#!/bin/bashcd /usr/bin//usr/bin/mysqldump -h [I]forummysqladdress[/I] -u [I]username[/I] -p[I]password dbname[/I] | gzip > $HOME/folder/folder/folder/forum_$(date +"%Y-%m-%d").sql.gz/usr/bin/mysqldump -h [I]articlesmysqladdress[/I] -u [I]username[/I] -p[I]password[/I] [I]dbname[/I] | gzip > $HOME/folder/folder/folder/articles_$(date +"%Y-%m-%d").sql.gz


No downloading required! :thumb1:

  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this