Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 18th March 2013, 14:49
almere almere is offline
ISPConfig Developer
Join Date: Nov 2012
Location: Netherlands, Rotterdam
Posts: 231
Thanks: 20
Thanked 39 Times in 34 Posts
Send a message via Skype™ to almere
Thumbs up Backup script ( no question, just script )

Hey guys.

I have made a backup script for my machines. Maybe you will like it

It's making a .gz file for each directory and puts all .gz files to *.tar archive. Than it will transfer the *.tar file to a FTP server.

I have 3 servers, each is something, like 1.5 TB. For each server it takes 1.5 hours to make full backup and transfer it. I also limited tar and gzip commands for 20% CPU usage, because it loaded my CPU for 99%

As security for my hosting is at first place, i backup almost everything. If you are not SOOOO paranoid, as i am, you should disable directories, like: root, sys, boot, lib, lib64, bin... etc.

Here it is:
### System Setup ###
### backup directory for temp. file sotrage.

### FTP ###
### your FTP server

### Binaries ###
TAR="$(which tar)"
GZIP="$(which gzip)"
FTP="$(which ftp)"

## Today + hour in 24h format ###
NOW=$(date +%Y%m%d)

### Create tmp dir ###
mkdir $BACKUP/$NOW
### you can add or delete directories. They will be set to *.gz file

$TAR -cf $BACKUP/$NOW/home.tar /home
$TAR -cf $BACKUP/$NOW/var.tar /var
$TAR -cf $BACKUP/$NOW/etc.tar /etc
$TAR -cf $BACKUP/$NOW/root.tar /root
$TAR -cf $BACKUP/$NOW/boot.tar /boot
$TAR -cf $BACKUP/$NOW/opt.tar /opt
$TAR -cf $BACKUP/$NOW/usr.tar /usr
$TAR -cf $BACKUP/$NOW/sys.tar /sys
$TAR -cf $BACKUP/$NOW/sbin.tar /sbin
$TAR -cf $BACKUP/$NOW/lib.tar /lib
$TAR -cf $BACKUP/$NOW/lib64.tar /lib64
$TAR -cf $BACKUP/$NOW/bin.tar /bin



### ftp ###
quote USER $FTPU
quote PASS $FTPP
cd $FTPD

### deleting temp files ###
rm -rf $ARCHIVED
rm -rf $DUMPFILE
echo "Backup finished and transferred"
Have fun.

UPD: see the post below, for full and complete backup structure.

Last edited by almere; 19th March 2013 at 09:18. Reason: updated
Reply With Quote
The Following User Says Thank You to almere For This Useful Post:
till (18th March 2013)
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about installing amanda backup server on Centos Sherly HOWTO-Related Questions 0 31st October 2012 04:11
Backup script for ISPConfig 3 datahellas Tips/Tricks/Mods 6 22nd April 2012 17:16
Online Backup : What do you use and how do you setup it ? XZed Technical 5 4th January 2010 19:02
Internet Explorer won't connect to my server wctaelectronics Server Operation 10 27th October 2008 22:14
Backup question.... toyito Installation/Configuration 3 11th February 2006 12:49

All times are GMT +2. The time now is 16:23.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.