#1  
Old 16th March 2011, 13:24
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Post Another FTP backup solution

Hello everyone,

Because of not finding a backup solution that fit my needs i've take some pieces from other scripts added some of my own and rewrite it to this one.

How it works:
The script makes a backup of the MySQL database in separate files (each DB has it own file) every 4 hours by using a cronjob, these files are stored in a local directory.

When finished the DB backup and the ISPconfig (Website) backup are copied to a FTP server, to prevent unneccessary load and bandwidth use the backup of the websites is copied once a day during the night (ISPconfig makes 1 backup at 0:30 so extra copies are not needed)

For this script the backup option in ISPconfig must be set.

Do NOT forget to change the < > values to fit your needs

A little manual is in top of the script.

Ronald
Attached Files
File Type: zip wdbackup.zip (1.6 KB, 293 views)
File Type: zip wdbackup2ftp.zip (3.2 KB, 239 views)
File Type: zip wdbackup2ftp-int.zip (3.1 KB, 220 views)

Last edited by ncoc.nl; 23rd June 2011 at 15:52. Reason: Rewritten wdbackup.sh
Reply With Quote
The Following 4 Users Say Thank You to ncoc.nl For This Useful Post:
ByteMe Networking (19th April 2011), falko (17th March 2011), nokia80 (2nd July 2011), till (16th March 2011)
Sponsored Links
  #2  
Old 23rd March 2011, 17:38
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Arrow

Still work in progress, I did some modifications.

What has changed?
The MySQL backup will now keep 7 day en 3 sunday backups, then the oldest will be deleted in the local backup.
The backup directory structure is changed, it will now create a time directory inside the date directory.
Added echo's for screen output when running the script in screen.

TODO:
  • Purge option on remote FTP server - Delete after 7 days, keep sunday for 3 weeks
  • Purge option on remote FTP server - Delete sunday backup after 22 days
  • Create exclusion "if directory exist"
  • Include ISPconfig and all files needed for a reatore in case of a crash
The script is as/is, it does work but I couldn't test the rotation for the 22 days.

Ronald
Attached Files
File Type: zip wdbackup_0.1.zip (2.1 KB, 265 views)
Reply With Quote
The Following 2 Users Say Thank You to ncoc.nl For This Useful Post:
ByteMe Networking (19th April 2011), falko (24th March 2011)
  #3  
Old 19th April 2011, 20:20
giganthost giganthost is offline
Junior Member
 
Join Date: Oct 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default good script

Hello,
thanks for this great script.

Please be possible in the script set to be compressed database?
Reply With Quote
  #4  
Old 20th April 2011, 15:30
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Default

The dump is done with mysqldump, you can compress the DB dir by using:

cd /var/backup
tar -pczf <your_filename>.tar.gz <your_directory_name>/

If neccessary you can delete the dir. afterwards, it will be created with the next backup.

Ronald
Reply With Quote
The Following User Says Thank You to ncoc.nl For This Useful Post:
i-chat (21st April 2011)
  #5  
Old 13th May 2011, 17:36
Croydon Croydon is offline
ISPConfig Developer
 
Join Date: Jul 2007
Location: Koblenz, Germany
Posts: 922
Thanks: 16
Thanked 258 Times in 206 Posts
Default

As I mentioned in a different thread, I would suggest adding the --hex-blob and --quote-names command line options to the mysqldump command.

If you have binary blob columns in your database you might run into trouble restoring it from a dump without hex-blob.
Reply With Quote
  #6  
Old 23rd June 2011, 15:48
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Default

Hi everyone,

For those who are interested, i did a complete rewrite of the wdbackup.sh and create 2 backupscripts, 1 for an external (your own?) FTP server and 1 for an internal FTP server (hired from or provided by the server hoster)

Short description:

Using an internal FTP backupserver.
This script will copy the websites backup files at 02.00H, the MySQL databases every 4 hours starting at 02.00H and the ISPconfig website and SQL database at 14.00H and 22:00H to an internal FTP server.
The MySQL backup databases on the local server will be purged every 7 days except the sunday backup, this database will be purged every 4 weeks.

Using an external FTP backupserver.
This script will copy the websites at 02.00H, the MySQL databases every 4 hours starting at 02.00H and the ISPconfig website and SQL database at 14.00H and 22:00H to a external FTP server of your choice. Every MySQL backup is overwritten after 24 hours, the websites backup is overwritten after 2 days. The MySQL backup databases on the local server will be purged every 7 days exept the sunday backup, this database will be purged every 4 weeks.

I've used the article http://www.howtoforge.com/forums/showthread.php?t=52466 which describes a standalone FTP server with a webinterface to setup my own backup solution.


The scripts are located in the first post
More information is in top of both scripts.

Ronald
Reply With Quote
The Following 3 Users Say Thank You to ncoc.nl For This Useful Post:
falko (24th June 2011), nokia80 (4th July 2011), till (23rd June 2011)
  #7  
Old 24th December 2011, 18:48
ncoc.nl ncoc.nl is offline
Member
 
Join Date: Feb 2011
Posts: 36
Thanks: 3
Thanked 17 Times in 11 Posts
Lightbulb Update

For some reason I can't edit my post so I reply myself

I did some modification of the original script:

wdbackup-1: backup to FTP once a day
wdbackup-6: backup the database 6 times a day, ISPconfig twice a day and the websites once a day.

Also the script checks the (local) diskspace and when running low it wil generate a e-mail which you can send to an second e-mail adres.

Al the info of the script is included in the header

Ronald
Attached Files
File Type: zip wdbackup-1.zip (3.8 KB, 80 views)
File Type: zip wdbackup-6.zip (3.7 KB, 80 views)
Reply With Quote
The Following User Says Thank You to ncoc.nl For This Useful Post:
falko (25th December 2011)
  #8  
Old 25th December 2011, 19:22
nokia80 nokia80 is offline
HowtoForge Supporter
 
Join Date: Apr 2009
Posts: 182
Thanks: 28
Thanked 2 Times in 2 Posts
Send a message via Skype™ to nokia80
Default

there is somting wrong in the new script when i run it

a lot of error

can create directory
Reply With Quote
Reply

Bookmarks

Tags
backup script, backup software, cron, cronjob

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
Online Backup : What do you use and how do you setup it ? XZed Technical 5 4th January 2010 18:02
Backup solution for VMware ESXi Hagforce Server Operation 4 9th October 2009 19:01
Looking for an automatic backup for ISPConfig unsichtbare Installation/Configuration 1 2nd May 2008 14:33
Backup Solution for Windows hoihtah Suggest HOWTO 1 5th February 2008 17:50
Setting up a backup mail server setup with two installations of ISPConfig zitch Tips/Tricks/Mods 7 30th December 2006 10:07


All times are GMT +2. The time now is 08:41.


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