PDA

View Full Version : How do I enable automatic backup?


drsintoma
1st March 2006, 06:03
Hi everyone.

That's it. How do I enable and configure automatic backup? I've been searching around and can't find anything.

falko
1st March 2006, 09:37
Have a look at these tutorials: http://www.howtoforge.com/howto_linux_systemimager
http://www.howtoforge.com/dedicated_server_backup_restore_systemimager
http://www.howtoforge.com/linux_rdiff_backup

drsintoma
1st March 2006, 09:43
Thanks, I know about backup tools. But I was talking about the backup that appears in the changelog (2.1.2).

Changelog
---------

- Added module for client and reseller invoices.
- Added slowenian error pages.
- Added automatic backup script for all customers.
- Improved update manager.
- Updated swedish, french and italian language files.
- Bugfix: Missing module error in WebFTP is fixed.

till
1st March 2006, 11:30
The backup runs automatically and stores a tar.gz backup file in the "backup" directory of each website.

If you dont have a backup directory in the website directories, please check if this line is in your root crontab:

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

drsintoma
1st March 2006, 15:27
The backup runs automatically and stores a tar.gz backup file in the "backup" directory of each website.

If you dont have a backup directory in the website directories, please check if this line is in your root crontab:

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

Now everything make sense. Thanks. :rolleyes:

dumb-medic
25th April 2006, 10:34
hello,

i have this line

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

in the crontab, but no backup-folders.
what can be wrong?

regards,
dumb-medic

falko
25th April 2006, 15:51
What happens if you run this command:
/root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php
on the shell (as root)?

dumb-medic
25th April 2006, 17:03
simply nothing, bash prompt.
in /var/log/messages no entry :confused:
and again no backup-folders.

till
25th April 2006, 21:50
The bash prompt returns without errors? How long does it take until the prompt returns?

dumb-medic
26th April 2006, 12:55
hitting enter brings the prompt, same second.

falko
26th April 2006, 13:57
Please set $go_info["server"]["do_automated_backups"] to 1 in /home/admispconfig/ispconfig/lib/config.inc.php.

dumb-medic
26th April 2006, 15:02
that did it, was set to 0.

dropped the crontab-line on bash as root again, all backup-folders including zips are made.

thanks falko, thanks till!
regards,
dumb-medic

chrno
3rd May 2006, 23:08
thanks for the info!

How often will this run? daily? I'll have to backup bind and apache files too right for complete backup?

till
4th May 2006, 07:38
The backup is only for the content of the websites. You will have to backup your configuration files and the ISPconfig database separately.

SupuS
21st July 2006, 22:45
Hi

Automatic backups didn't work for me. In crontab I have appropriate line and in my /home/admispconfig/ispconfig/lib/config.inc.php I set up backups to 1 and wait for couple days .. and nothing .. in backups directory is only one backup which I created by

/root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php

and in /var/log/messages or /var/log/syslog no error ... :confused:

This problem I had in previous version of ISPconfig and after upgrade to latest version it remains ..

any idea?

falko
22nd July 2006, 17:13
What do you see when you run
/home/admispconfig/ispconfig/tools/zip/zip -h? Maybe there's a problem with zip...

SupuS
22nd July 2006, 22:37
What do you see when you run
/home/admispconfig/ispconfig/tools/zip/zip -h? Maybe there's a problem with zip...

Output of this command is

# /home/admispconfig/ispconfig/tools/zip/zip -h
Copyright (C) 1990-1999 Info-ZIP
Type 'zip "-L"' for software license.
Zip 2.3 (November 29th 1999). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
The default action is to add or replace zipfile entries from list, which
can include the special name - to compress standard input.
If zipfile and list are omitted, zip compresses stdin to stdout.
-f freshen: only changed files -u update: only changed or new files
-d delete entries in zipfile -m move into zipfile (delete files)
-r recurse into directories -j junk (don't record) directory names
-0 store only -l convert LF to CR LF (-ll CR LF to LF)
-1 compress faster -9 compress better
-q quiet operation -v verbose operation/print version info
-c add one-line comments -z add zipfile comment
-@ read names from stdin -o make zipfile as old as latest entry
-x exclude the following names -i include only the following names
-F fix zipfile (-FF try harder) -D do not add directory entries
-A adjust self-extracting exe -J junk zipfile prefix (unzipsfx)
-T test zipfile integrity -X eXclude eXtra file attributes
-y store symbolic links as the link instead of the referenced file
-R PKZIP recursion (see manual)
-h show this help -n don't compress these suffixes

till
23rd July 2006, 11:07
If the backup works if you run:

/root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php

then I guess you have a cron error. Please check your root crontab at which time the backup script is executed and then have a look at your syslog if you get cron errors in this time period.

SupuS
24th July 2006, 11:01
If I execute backup manualy I get:

# /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/f5deba956ee428ec03ec9615467911f0/web20_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/305da47d27d13c7f5513be666ecacd54/web22_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/928c37c9776f9da3cb088a6102ec8c99/web28_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/a3d95fc162fdccff67dbd5f34b64b2c1/web32_user.zip . -i *)

These webs has not any data yet. I don't know if it is fatal error or not but I have backup files in backup dirs and in backup.php is -ry (I have latest version of ISPConfig). In syslog is not any line with *CRON* or *backup* in a defined time.

I tried change crontab line to

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /root/backup.txt

but in my root directory is not any new file .. what is wrong? :(

my crontab:

# crontab -l
30 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/ftp_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/cleanup.php &> /dev/null
0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
0,30 * * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/check_services.php &> /dev/null
15 3,15 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/quota_msg.php &> /dev/null
40 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/traffic.php &> /dev/null
05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

till
24th July 2006, 11:08
The backups where not stored in your root directory, they where stored in the backup directory of the website.

SupuS
24th July 2006, 13:11
I know it .. I wanted test if backup is working by modifiing

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

to

05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /root/backup.txt

and I expected backup.txt file in my root directory .. but there was no backup.txt

falko
25th July 2006, 13:41
What's the output of ls -la /home/admispconfig/ispconfig/temp?

What happens now when you run
/root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php?

bschultz
25th July 2006, 20:38
What's the output of ls -la /home/admispconfig/ispconfig/temp?

total 8
drwxr-xr-x 2 admispconfig admispconfig 4096 Jul 25 13:23 .
drwxr-xr-x 8 admispconfig admispconfig 4096 Jul 24 13:28 ..

What happens now when you run
/root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php?
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -r /home/admispconfig/ispconfig/temp/62bfa0608182b52cfa8c5f5b36ec8806/web3_user.zip . -i *)

Which I tried...and it gave me this:


zip warning: name not matched: .kde/socket-localhost
zip warning: name not matched: .kde/tmp-localhost
zip I/O error: No such file or directory

zip error: Could not create output file (/home/admispconfig/ispconfig/temp/62bfa0608182b52cfa8c5f5b36ec8806/web3_user.zip)


Any ideas?

SupuS
25th July 2006, 20:45
# ls -la /home/admispconfig/ispconfig/temp
celkem 190548
drwxr-xr-x 8 admispconfig admispconfig 4096 2006-07-24 10:31 .
drwxr-xr-x 8 admispconfig admispconfig 4096 2006-07-25 18:57 ..
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 21:27 4a4b184eb64b07d368410afa3c3c5451
-rwxr-xr-x 1 admispconfig admispconfig 185739938 2006-07-04 19:28 5a0f8ca8bed47e68f257012f994d514b.zip
-rwxr-xr-x 1 admispconfig admispconfig 4564092 2006-07-04 21:28 7084c0e33e4e5567e836fa7b5d7b4919.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 19:28 964bdee99cfacf64337c3838cee7b488
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-06-01 23:25 bf8af9eb4f765e5cbe0a8f15a1a43282
-rwxr-xr-x 1 admispconfig admispconfig 4564092 2006-07-04 21:27 f0cc53b5aba398ba73befe471aafcc68.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 21:28 f4a5874ade18b559b07b60194939d0c6
-rwxr-xr-x 1 admispconfig admispconfig 0 2006-06-29 01:23 hta_nMqhJz
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-06-04 16:31 roundcubemail
drwxr-xr-x 12 admispconfig admispconfig 4096 2006-07-25 18:57 webmail


# /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/00040bb6a0091483a2b166b628a668d7/web20_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/2e1bc07df1cbf76680168abbb119b6b4/web22_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/07667b363a59200ba093d66bf83d0038/web28_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/efd7246204e82ef3d7e43dd40883e9bc/web32_user.zip . -i *)

after manualy backup is content of temp same :eek:

# ls -la /home/admispconfig/ispconfig/temp
celkem 190548
drwxr-xr-x 8 admispconfig admispconfig 4096 2006-07-25 20:29 .
drwxr-xr-x 8 admispconfig admispconfig 4096 2006-07-25 18:57 ..
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 21:27 4a4b184eb64b07d368410afa3c3c5451
-rwxr-xr-x 1 admispconfig admispconfig 185739938 2006-07-04 19:28 5a0f8ca8bed47e68f257012f994d514b.zip
-rwxr-xr-x 1 admispconfig admispconfig 4564092 2006-07-04 21:28 7084c0e33e4e5567e836fa7b5d7b4919.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 19:28 964bdee99cfacf64337c3838cee7b488
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-06-01 23:25 bf8af9eb4f765e5cbe0a8f15a1a43282
-rwxr-xr-x 1 admispconfig admispconfig 4564092 2006-07-04 21:27 f0cc53b5aba398ba73befe471aafcc68.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-07-04 21:28 f4a5874ade18b559b07b60194939d0c6
-rwxr-xr-x 1 admispconfig admispconfig 0 2006-06-29 01:23 hta_nMqhJz
drwxr-xr-x 2 admispconfig admispconfig 4096 2006-06-04 16:31 roundcubemail
drwxr-xr-x 12 admispconfig admispconfig 4096 2006-07-25 18:57 webmail


in the backup directories of webs are files with today's date

falko
26th July 2006, 10:26
We will check that.

SupuS
26th July 2006, 21:58
Thanks Falko :)

SupuS
4th August 2006, 00:03
Any news? Please? :o

falko
4th August 2006, 13:51
We didn't have the time yet. I put this into our bugtracker, and Till or I will work on it.

SupuS
4th August 2006, 13:57
Thanks a lot .. the time is problem for me too .. I know it .. ;) Tell me if I can help you with testing of something ..

falko
5th August 2006, 16:52
All you can do is give us some time to test this and find a solution, if necessary. This forum and HowtoForge in general takes us a lot of time, so it's difficult for us to do other things... (Wait: there's one thing everyone can do: answer other people's questions if possible. This would be a great relief for Till and me... :))

till
8th September 2006, 19:56
I tested the backup script on Centos and it worked finr. SupuS, on which distribution do you get the errors?

SupuS
9th September 2006, 13:06
I tested the backup script on Centos and it worked finr. SupuS, on which distribution do you get the errors?

Hi till

I have ubuntu dapper server ... and backup script still doesn't work for me .. If I ran it by

# /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/4aa72ca18befc9934e006b54a0c4e45c/web20_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/04ae3e6e61a92b6c31720c089143b412/web41_user.zip . -i *)
zip warning: name not matched: *

zip error: Nothing to do! (try: zip -ry /home/admispconfig/ispconfig/temp/c4afe2f7ccc9cb77ceceeecab3cdc0e3/web42_user.zip . -i *)


everything is ok .. backup is created for each user .. except some empty dirs .. I think .. but script don't work automaticaly by cron ..

and this is in my temp .. still not changed ..

# ls -la /home/admispconfig/ispconfig/temp
total 190548
drwxr-xr-x 8 admispconfig admispconfig 4096 Sep 9 12:51 .
drwxr-xr-x 8 admispconfig admispconfig 4096 Sep 7 10:15 ..
drwxr-xr-x 2 admispconfig admispconfig 4096 Jul 4 21:27 4a4b184eb64b07d368410afa3c3c5451
-rwxr-xr-x 1 admispconfig admispconfig 185739938 Jul 4 19:28 5a0f8ca8bed47e68f257012f994d514b.zip
-rwxr-xr-x 1 admispconfig admispconfig 4564092 Jul 4 21:28 7084c0e33e4e5567e836fa7b5d7b4919.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 Jul 4 19:28 964bdee99cfacf64337c3838cee7b488
drwxr-xr-x 2 admispconfig admispconfig 4096 Jun 1 23:25 bf8af9eb4f765e5cbe0a8f15a1a43282
-rwxr-xr-x 1 admispconfig admispconfig 4564092 Jul 4 21:27 f0cc53b5aba398ba73befe471aafcc68.zip
drwxr-xr-x 2 admispconfig admispconfig 4096 Jul 4 21:28 f4a5874ade18b559b07b60194939d0c6
-rwxr-xr-x 1 admispconfig admispconfig 0 Jun 29 01:23 hta_nMqhJz
drwxr-xr-x 2 admispconfig admispconfig 4096 Jun 4 16:31 roundcubemail
drwxr-xr-x 16 admispconfig admispconfig 4096 Sep 5 15:33 webmail

in my crontab is:

# crontab -l
30 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/ftp_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/cleanup.php &> /dev/null
0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
0,30 * * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/check_services.php &> /dev/null
15 3,15 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/quota_msg.php &> /dev/null
40 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/traffic.php &> /dev/null
05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null

falko
10th September 2006, 19:24
Which ISPConfig version do you have installed?

SupuS
10th September 2006, 19:59
Which ISPConfig version do you have installed?

ISPConfig Version: 2.2.6

falko
11th September 2006, 13:50
Strange... :confused:

SupuS
11th September 2006, 15:55
Strange... :confused:

:( I have no idea what is wrong .. in my syslog is no mention about backup script ...

falko
12th September 2006, 16:17
:( I have no idea what is wrong ..
Me neither... :(