Jump to content
  • Welcome To Mopar1973Man.Com

    We can see that your guest and been lurking about. When you register on the Mopar1973Man.Com site you'll be able to interact with all the other members. This is the most friendliest Cummins forum you'll ever join. Take the time right now and  REGISTER  on the Mopar1973Man.Com this will open up many more options and functions on the website. Everyone is very friendly and helpful just ask questions and everyone will help you out the best they can. 

Sign in to follow this  
Mopar1973Man

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.

forum-backup-06-08-2012.tar.gz

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.

articles-backup-06-08-2012.tar.gz

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
forum_2012-06-08.sql.gz

articles_2012-06-08.sql.gz

No downloading required! :thumb1:

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Donation Goals

    Mopar1973Man Medical Bills

    If you want to donate to Michael Nelson medical bills. Any fund donated here will be directed toward the medical bills and getting them paid. 


    30%
    $150.00 of $500.00 Donate Now


×
×
  • Create New...