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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th October 2008, 02:23
_X_ _X_ is offline
Senior Member
 
Join Date: Oct 2008
Posts: 247
Thanks: 8
Thanked 37 Times in 35 Posts
Question Client Site BackUp for more than one day?

When autobackup is enabled ISPConfig delete all files in backup folder and creates backup for last day.

http://www.howtoforge.com/forums/showthread.php?t=12339

Is there a way to set how many days to keep backups or how to set ISPConfig not to delete backup files?
Reply With Quote
Sponsored Links
  #2  
Old 13th October 2008, 12:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

This is currently not possible.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 13th October 2008, 19:56
mccharlet mccharlet is offline
Senior Member
 
Join Date: Feb 2007
Posts: 261
Thanks: 60
Thanked 10 Times in 7 Posts
Default

Hi

I have modify the backup script to redirect the backup to /backup

I have change this

HTML Code:
                // Move file in /backup directory
//                $backup_dir = $httpd_root ."/web".$web_id."/backup";
                $backup_dir = "/backup/web".$web_id;
//                $web_user = fileowner($web_pfad);
//                $web_group = filegroup($web_pfad);
                if(!@is_dir($backup_dir)) {
                  mkdir($backup_dir,0755);
                } else {
                  exec("rm -rf $backup_dir/*");
                }
/*                if(@fileowner($backup_dir) != $web_user) {
                  chown($backup_dir,$web_user);
                }
                if(@filegroup($backup_dir) != $web_group) {
                  chgrp($backup_dir,$web_group);
                }
*/
I have create a perl script for moving the backup file to the same folder and rename them

HTML Code:
#!/usr/bin/perl
$repertoire = @ARGV[0];
$rep_backup= @ARGV[1];
$fichier_log= @ARGV[2];

open LOG,">".$fichier_log;
if ( @ARGV != 3 )
{
        print "\nSyntax: perl mv-backup.pl repertoire_sources repertoire_dest fichier_log \n\n";
        exit 1;
}

if (substr($repertoire,length($repertoire)-1) ne "/"){
        $repertoire = $repertoire."/";
}

#lecture des fichiers d'un repertoire
opendir REP,$repertoire or die "impossible d'ouvrir le repertoire";
@fichiers = readdir REP;
closedir REP;
foreach $fichier (@fichiers){
        $prefixe= $fichier."_";
        $fichier = $repertoire.$fichier;

        if (($fichier ne $repertoire."..") and ($fichier ne $repertoire.".") and (-d $fichier)){
                $fichier=$fichier."/";
                opendir REP,$fichier or die "impossible d'ouvrir le repertoire";
                @fichiers2 = readdir REP;
                closedir REP;

          foreach $fichier2 (@fichiers2){
                        $nom_fichier = $fichier2;
                        $fichier2 = $fichier.$fichier2;
                        if (-f $fichier2){
                                print LOG "$fichier2\n";

                                rename $fichier2,$rep_backup.$prefixe.$nom_fichier;
                                print $fichier2,$rep_backup.$prefixe.$nom_fichier."\n\r";
                        }
                }

        }
}
close LOG;
perl mv-backup.pl /backup/ /sites/ log_file_mv.txt

And with this command i delete older than four days
find /sites/ -mtime +4 -exec rm {} \;
__________________
Thanks
Cédric

Sorry for my english

Hosting : http://www.jheberge.ch
Reply With Quote
The Following User Says Thank You to mccharlet For This Useful Post:
_X_ (13th October 2008)
  #4  
Old 22nd July 2010, 22:42
scottrill2 scottrill2 is offline
HowtoForge Supporter
 
Join Date: Dec 2009
Posts: 93
Thanks: 21
Thanked 2 Times in 1 Post
 
Default Is this still valid?

Hello folks,


I find myself making lots of mistakes while learning about webs etc. Im trying to teach myself multiple things so I have for instance a practice drupal site, practice joomla site, practice word press site etc.


I often forget to make a backup then I screw the proverbial pooch on something, and have to start waaaaay back to my last backup. (which maybe isnt a bad thing since it makes me practice over and over lol)

I have a few questions regarding this autobackup setup.

1. Is this still the best way to do autobackups, with the post being two years old? I found this one searching http://www.howtoforge.com/forums/sho...=backup+script But that one looks highly complex and also says restoring etc can have very bad results, should I pursue this route or the other one?


2. The code that is in swiss or french, can that just be plugged into google translate? I know sometimes things don't translate well because of verb conjugation etc.

3. Once translated I would save it to cgi bin? and run the command listed at the bottom?


Thanks as always,

Scott
Reply With Quote
Reply

Bookmarks

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
Add a site to a client kippi General 2 25th January 2007 11:51
problems moving website, doesnt delete site from original client... lyndros Installation/Configuration 7 11th October 2006 10:27
Add Existing Site to Client? mphetameme General 3 10th September 2006 00:59
ISPConfig wont backup a site PortMan General 8 22nd July 2006 15:49
change report client / site fpl General 18 29th June 2006 13:25


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


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