Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Plugins/Modules/Addons

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #151  
Old 18th January 2012, 02:21
wcsing wcsing is offline
Member
 
Join Date: Dec 2011
Posts: 36
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Hi go0ogl3,

please let me know the steps how to run your backup script. Sorry i never run a cron job before. do i need to rename the downloaded file to .SH? or how to put it in ISP3 > sites > corn job? Thanks
Reply With Quote
Sponsored Links
  #152  
Old 19th January 2012, 19:55
(O)fer_cz (O)fer_cz is offline
Junior Member
 
Join Date: Sep 2011
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by go0ogl3 View Post
Yes. You have to enter all the websites you wish to backup in
DIRECTORIES variable in the script. Example:

Code:
DIRECTORIES="/var/www/web1 /var/www/web2 /var/www/web3"
take care with the simlinks... tar backs up only the simlink, not the target content!
thanks for response, but its not good for auto-backup, because clients and webs changes...
__________________
IBM Server x3550 797841G, VMWare ESXi 5, Debian 6 Squeeze, ISPConfig 3, multi-server setup
Reply With Quote
  #153  
Old 1st February 2012, 17:46
go0ogl3 go0ogl3 is offline
Member
 
Join Date: Jul 2008
Posts: 73
Thanks: 5
Thanked 39 Times in 6 Posts
Default

Quote:
Originally Posted by (O)fer_cz View Post
thanks for response, but its not good for auto-backup, because clients and webs changes...
I'm using this script only from cron, so I think this is auto-backup...
__________________
__________________
go0ogl3
--
Keep your work safe. Better backup than sorry! Download the latest version of the backup and restore script. See more info here.
Reply With Quote
  #154  
Old 5th March 2012, 13:22
n47 n47 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello

Thank you for your script. It's working perfectly but I have a problem when I try to launch the script with CRON.

Actually, if I run manually the script with this command

Code:
/etc/back-res.sh
The script back up my datas. But if Cron launchs the script, nothing happens... I tried to see if there is errors in cron.log but I don't see them ...

Quote:
Mar 5 12:09:01 azur /USR/SBIN/CRON[15470]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete)
Mar 5 12:09:01 azur /USR/SBIN/CRON[15469]: (root) CMD (/usr/bin/php -q /var/www/clients/client1/web1/web/periodic/cron.php)
Mar 5 12:10:01 azur /USR/SBIN/CRON[15493]: (root) CMD (/ect/back-res.sh 1>/dev/null 2>/dev/null)
Mar 5 12:10:01 azur /USR/SBIN/CRON[15492]: (root) CMD (/usr/local/ispconfig/server/server.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
Mar 5 12:10:01 azur /USR/SBIN/CRON[15494]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /var/log/ispconfig/cron.log)
Mar 5 12:10:01 azur /USR/SBIN/CRON[15495]: (root) CMD (/usr/bin/php -q /var/www/clients/client1/web1/web/periodic/cron.php)
Cron is working, I do a simple test by creating a file and it's working.

The only crontask which is not working is this one :

10 12 * * 1 /ect/back-res.sh 1>/dev/null 2>/dev/null

Do you have an idea ?

Thank you.
Reply With Quote
  #155  
Old 5th March 2012, 14:04
n47 n47 is offline
Junior Member
 
Join Date: Mar 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by n47 View Post
Hello

Thank you for your script. It's working perfectly but I have a problem when I try to launch the script with CRON.

Actually, if I run manually the script with this command

Code:
/etc/back-res.sh
The script back up my datas. But if Cron launchs the script, nothing happens... I tried to see if there is errors in cron.log but I don't see them ...



Cron is working, I do a simple test by creating a file and it's working.

The only crontask which is not working is this one :

10 12 * * 1 /ect/back-res.sh 1>/dev/null 2>/dev/null

Do you have an idea ?

Thank you.
Problem solved, I rename /etc/back-res.sh with /etc/back-res and I replace cron task 10 12 * * 1 /ect/back-res.sh 1>/dev/null 2>/dev/null with 10 12 * * 1 /ect/back-res 1>/dev/null 2>/dev/null
Reply With Quote
  #156  
Old 18th April 2012, 00:49
riverman riverman is offline
Junior Member
 
Join Date: Nov 2005
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
Default Problem with / in date from ls

Hi,

I have problem to restore a backup. I get:

Code:
[root@ispconfig4 web6]# ~/back-res.sh dir all 2012-04-17
date: invalid date `04/'
/root/back-res.sh: line 452: [: : integer expression expected
The date command seems ok:
Code:
[root@ispconfig4 log]# date +%d
18
[root@ispconfig4 log]# date +%F
2012-04-18
[root@ispconfig4 log]# date +%Y-%m
2012-04
Code:
[root@ispconfig4 web6]# ls -ctF $BACKUPDIR
full_var-2012-04-17.tar.bz2   full_root-2012-04-17.tar.bz2   full_etc-2012-04-17.tar.bz2   full_boot-2012-04-17.tar.bz2
full_usr-2012-04-17.tar.bz2   full_lib64-2012-04-17.tar.bz2  full_home-2012-04-17.tar.bz2  2012-04/
full_sbin-2012-04-17.tar.bz2  full_lib-2012-04-17.tar.bz2    full_bin-2012-04-17.tar.bz2   log/
But the ls-command seems to leave a /-sign in the end of the date:

Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6
full_var-2012-04-17.tar.bz2   full_root-2012-04-17.tar.bz2   full_etc-2012-04-17.tar.bz2   full_boot-2012-04-17.tar.bz2
full_usr-2012-04-17.tar.bz2   full_lib64-2012-04-17.tar.bz2  full_home-2012-04-17.tar.bz2  2012-04/
full_sbin-2012-04-17.tar.bz2  full_lib-2012-04-17.tar.bz2    full_bin-2012-04-17.tar.bz2   log/
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6 | grep -v ^log/
full_var-2012-04-17.tar.bz2
full_usr-2012-04-17.tar.bz2
full_sbin-2012-04-17.tar.bz2
full_root-2012-04-17.tar.bz2
full_lib64-2012-04-17.tar.bz2
full_lib-2012-04-17.tar.bz2
full_etc-2012-04-17.tar.bz2
full_home-2012-04-17.tar.bz2
full_bin-2012-04-17.tar.bz2
full_boot-2012-04-17.tar.bz2
2012-04/
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1
2012-04/
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1 | cut -d "-" -f 2
04/
The ls command ends a directory with / and therefor will the date be wrong...

Dist: Centos 6.2 64-bit

Code:
Variables section
-----------------
COMPUTER="web6"
DIRECTORIES="/bin /boot /etc /home /lib /lib64 /root
/sbin /usr /var"                    # directories to backup
EXCLUDED="/bck /tmp /dev /proc /sys /srv /media
/var/adm /var/cache /var/lib/mysql
/var/run /var/lock /lib/init/rw /var/tmp
/var/log/verlihub /var/lib/amavis /var/amavis /var/spool/postfix/p*
/var/spool/postfix/var
/var/www/clients/client2/web5/webdav/data
/var/named/chroot/proc *.pid *.lock *.lck"        # exclude those dir's and files
BACKUPDIR="/bck/$COMPUTER"                # where to store the backups
dbuser="root"                        # database user
dbpassword="password"                # database password
email="mans.aman@riverman.com"                # mail for the responsible person
TAR=`which tar`                        # name and location of tar
ARG="-cjpSPf"        #sparse                # tar arguments P = removed /.
EARG="-xjpf"                        # tar extract arguments P = removed /
tmpdir="/tmp/tmpbck"                    # temp dir for database dump and other stuff
del_en="yes"                        # Enable delete of files if used space percent > than $maxp (yes or anything else)
maxp="85"                        # Max percent of used space before start of delete
hm="2359"                        # last minute of the day = last minute of the restored backup of the day restored
Any ideas how to fix this?

/Mĺns
Reply With Quote
  #157  
Old 23rd April 2012, 21:59
lobius lobius is offline
Member
 
Join Date: Apr 2012
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Code:
note     : Table does not support optimize, doing recreate + analyze instead
roundcube.users
note     : Table does not support optimize, doing recreate + analyze instead
mysqldump: Got error: 1044: Access denied for user 'root'@'localhost' to database 'information_schema' when using LOCK TABLES


Are my tables being backed up anyway?

There is no problem with root@localhost.

Why does that message show up?

Excellent script. :-) Thanks.
Reply With Quote
  #158  
Old 23rd April 2012, 22:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,421
Thanks: 834
Thanked 5,500 Times in 4,329 Posts
Default

The error messages are ok. Not every mysql table type can be optimized and the information_schema database is a internal mysql database structure, so you can not back that up and it does not need to be included in the backup.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
lobius (24th April 2012)
  #159  
Old 24th April 2012, 00:07
riverman riverman is offline
Junior Member
 
Join Date: Nov 2005
Posts: 9
Thanks: 3
Thanked 0 Times in 0 Posts
Thumbs up Needed changes on Centos 6.2 64-bit

Quote:
Hi,

I have problem to restore a backup. I get:

Code:
[root@ispconfig4 web6]# ~/back-res.sh dir all 2012-04-17
date: invalid date `04/'
/root/back-res.sh: line 452: [: : integer expression expected
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1
2012-04/
Code:
[root@ispconfig4 web6]# ls -ctF /bck/web6  | grep -v ^log/ | tail -n 1 | cut -d "-" -f 2
04/
The ls command ends a directory with / and therefor will the date be wrong...
So I changed the lines beginning with year=, md= and day= so they are like this:
Code:
year=`ls -ct $BACKUPDIR | grep -v ^log  | tail -n 1 | cut -d "-" -f 1`
md=`ls -ct $BACKUPDIR | grep -v ^log | tail -n 1 | cut -d "-" -f 2`
day=`ls -ct $BACKUPDIR | grep -v ^log | tail -n 1 | cut -d "-" -f 3 | cut -d "." -f 1`
I also had to make sure the tmpdir= variable was pointing to a valid directory which it didn't on Centos 6.2 64-bit.

Now everything works great! I was backing up a production mail server because we needed to move to a new server.
Reply With Quote
  #160  
Old 24th April 2012, 01:53
lobius lobius is offline
Member
 
Join Date: Apr 2012
Posts: 41
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default

Code:
/bin/tar: /var/www/roundcube/logs/errors: file changed as we read it
/bin/tar: /var/spool/postfix/dev/log: socket ignored
/bin/tar: /www: Cannot stat: No such file or directory
/bin/tar: Exiting with failure status due to previous errors
Looks like the databases backed up just fine.

I understand the roundcube problem. I attempted to back up in the middle of the day and something changed.

Not sure about the /www error. Should I change that to /var/www or remove it from the script?

Quote:
Originally Posted by till View Post
The error messages are ok. Not every mysql table type can be optimized and the information_schema database is a internal mysql database structure, so you can not back that up and it does not need to be included in the backup.
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
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 16:54
how to restore Ispconfig from backup db na0lb Installation/Configuration 4 24th September 2008 08:51
Restore backup ISPConfig leeeonardo General 4 18th April 2007 20:21
Restore ispconfig complete backup statiic General 1 15th January 2007 10:32
Backup restore on ispconfig misterm Installation/Configuration 0 18th December 2005 23:32


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


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