HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Plugins/Modules/Addons (http://www.howtoforge.com/forums/forumdisplay.php?f=34)
-   -   ISPConfig 3 - back-res a Backup and Restore script (http://www.howtoforge.com/forums/showthread.php?t=41609)

go0ogl3 6th December 2009 20:38

ISPConfig 3 - back-res a Backup and Restore script
 
Hello!

ISPConfig 3 is a great piece of software. I want to contribute with a little script, maybe somebody will make a module and insert it in ISPConfig 3 if it's usefull.

I use ISPConfig 3 in production on a small little used server and I have created a backup and restore script.
I've tryied to make myself understood in the script. The script can be used to backup a full or partial linux system with a full mysql dump.
My script is using only one full backup a month, the rest are incremental backups. This uses less space and less ressources. There are some drawbacks, but I haven't find anything like this on the net, so I created this little script and I hope I will have more time to make it better later.
For now this script is in a "It works for me" state, but I think it can be used safely if the user takes his time and reads all the info in the script header.

The link: http://www.eurosistems.ro/back-res

Thank you for good free software!

nokia80 9th December 2009 07:33

things to do
 
hi


beautiful script can explain you maby which codes must use you to manage script for backup and also for put back where script must come etc......:confused:

sees good nice

go0ogl3 9th December 2009 21:40

Quote:

Originally Posted by nokia80 (Post 213032)
hi


beautiful script can explain you maby which codes must use you to manage script for backup and also for put back where script must come etc......:confused:

sees good nice

For backup the script is used without any arguments and it's supposed to be run from cron from a line like:
40 3 * * * /etc/back-res 1>/dev/null 2>/dev/null

Please read the info in the first lines of the script. I've tried to explain how the script functions there. If you have more questions please ask.

Snake12 13th December 2009 15:52

Hi, i have a problem on my server (Ubuntu 8.04.3 LTS) with your script.

admin@serverWeb:/root$ sudo ./back-res
df: `/bck/serverWeb.adsl.net': No such file or directory
df: no file systems processed
./back-res: line 230: [: -gt: unary operator expected
mkdir: cannot create directory `/bck/serverWeb.adsl.net/log': No such file or directory
./back-res: line 167: /bck/serverWeb.adsl.net/log/backup.log: No such file or directory
./back-res: line 173: /bck/serverWeb.adslnocable.it/log/backup.log: No such file or directory
mkdir: cannot create directory `/bck/serverWeb.adsl.net/log': No such file or directory
./back-res: line 167: /bck/serverWeb.adslnocable.it/log/backup.log: No such file or directory


can u help me ?

Thanks!!

skoena 14th December 2009 08:05

I runned the script but it hangs and gives me some errors. Can somebody tell me what they mean?

Quote:

note : The storage engine for the table doesn't support optimize
/bin/tar: /adm: Cannot stat: No such file or directory
/bin/tar: Error exit delayed from previous errors
/bin/tar: /var/log/kern.log: file changed as we read it
/bin/tar: /var/log/ConsoleKit/history: file changed as we read it
/bin/tar: /var/log/syslog: file changed as we read it
/bin/tar: /var/lib/apache2/fcgid/sock/8504.0: socket ignored
/bin/tar: /var/lib/apache2/fcgid/sock/14689.0: socket ignored
/bin/tar: /var/lib/apache2/fcgid/sock/14541.0: socket ignored
Tnx,
Rudolf.

EDIT: I executed the script on another (my new) server and here no error messages.

skoena 14th December 2009 12:08

What's the easiest or best way to backup to an existing Windows 2003 server?

Should I do this with a mount? Or use FTP to upload the files to the server? Or are there better ways to do this? Please advise.

go0ogl3 1st January 2010 11:11

Quote:

Originally Posted by Snake12 (Post 213413)
Hi, i have a problem on my server (Ubuntu 8.04.3 LTS) with your script.

admin@serverWeb:/root$ sudo ./back-res
df: `/bck/serverWeb.adsl.net': No such file or directory
df: no file systems processed
./back-res: line 230: [: -gt: unary operator expected
mkdir: cannot create directory `/bck/serverWeb.adsl.net/log': No such file or directory
./back-res: line 167: /bck/serverWeb.adsl.net/log/backup.log: No such file or directory
./back-res: line 173: /bck/serverWeb.adslnocable.it/log/backup.log: No such file or directory
mkdir: cannot create directory `/bck/serverWeb.adsl.net/log': No such file or directory
./back-res: line 167: /bck/serverWeb.adslnocable.it/log/backup.log: No such file or directory


can u help me ?

Thanks!!

You need to configure corectly the backup dir, line 107 from the script, "BACKUPDIR" variable. It's the place where to store the backups and it must exist.

P.S.: sorry for the delay in answer, hope will help you!

go0ogl3 1st January 2010 11:20

Quote:

Originally Posted by rudolfpietersma (Post 213446)
I runned the script but it hangs and gives me some errors. Can somebody tell me what they mean?



Tnx,
Rudolf.

EDIT: I executed the script on another (my new) server and here no error messages.

Please read carefully the comentaries on the script. The script tries to backup the directories from the "DIRECTORIES" variable in line 100.
You do not have the /adm directoy that it's why you get the error:
Code:

/bin/tar: /adm: Cannot stat: No such file or directory
The other errors are because the file are modified by external programs when tar tries to archive them (syslog and console-kit in your case). The last errors are because the files are actually sockets, not real files. You can use the "EXCLUDED" variable, in line 102 of the script, to exclude files (sockets) or directories you do not wish to backup.

P.S.: Sorry for the delay in answer, I have been verry busy in the year end.

go0ogl3 1st January 2010 11:35

Quote:

Originally Posted by rudolfpietersma (Post 213458)
What's the easiest or best way to backup to an existing Windows 2003 server?

Should I do this with a mount? Or use FTP to upload the files to the server? Or are there better ways to do this? Please advise.

It's a simple answer. Let's take the two cases you provided:
  1. you have a linux server on wich you run the backup script and you mount a samba share from Windows 2003 server:
    The script gets the larger files and archives them locally on the server and consumes the bandwith twice (with the S = sparse tar argument) to read the
    files from the Windows 2003 share. So if the share is 1Gb the bandwith consumed is 2Gb and the archive can take longer to make compared to the second case.
  2. you have a linux server on wich you run the backup script and you already have uploaded the files you wish to archive, 1Gb worth of files, 1Gb bandwith used.
    The script takes less to archive files (they are accesed localy) and the bandwith consumed is 1Gb.

Conclusion:
  • Those two cases are good if you want to keep the Windows 2003 backup on the linux server. This is good, you have data redundancy :cool:
    If the linux and Windows are on a local lan both metoths are good. If the computers are on the internet, the first case it's not so good, it consumes more resources.

P.S.: Hope this helps you! Sorry for the delay... too much work.

HyperAtom 10th January 2010 22:55

Amazing script, works like a charm thanks go0ogl3 :)


All times are GMT +2. The time now is 07:13.

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