Last edited by LaFong; 08-27-2010 at 06:20 PM.
Thanks for your help !!
What I need is to make the full backup on Saturday or Sunday.
So I need to edit the cron job and with the %U should start on Sunday, but what If I need another day ? (like Saturday).
Also, this parameter should be changed in:
BACKUPWEEK=`date +%W`
or
date +%W > $BACKUPWEEKFILE
Thanks again!
Regards.
--
AGD
I won't matter if you do the full on a day of the week after Sunday or Monday. Either option will give you the same week.
The first version above should be commented out in your script, i.e. have a "#" in front of itAlso, this parameter should be changed in:
BACKUPWEEK=`date +%W`
or
date +%W > $BACKUPWEEKFILE
That was the older method of setting BACKUPWEEK.Code:# BACKUPWEEK=`date +%W`
Yes, sorry the "BACKUPWEEK=`date +%W`" is cmmented on my script.
But if for example the week starts on Monday and if I configure the full backup for Tuesday, on Monday as I don't have a full backup for this week, the script is not going to make a full ?
--
AGD
Whether it does a full or not is entirely dependent on your crontab. The date %U or %W options only concern the first day of the week. If you're not running the full on the first day of the week, that setting does not matter. If you don't have a full already, and want to do a full on early Tuesday morning, just change your crontab for one day:
I just commented out the diff so it wouldn't try to do both a full and diff the same day. When you get your full, change the crontab back:Code:1 2 * * 2 /bin/bash /usr/local/sbin/zmbak.sh -f > /var/log/zim_backup.log 2>&1 #0 3 * * 2-7 /bin/bash /usr/local/sbin/zmbak.sh -d > /var/log/zim_backup.log 2>&1
Your crontab will vary, obviously. By the way, I had not noticed the BACKUPWEEK change in v0.8, so the ISO week %V option is not necessary to bypass the end-of-year issues in v0.7 and earlier. That option does help my version of the script, which has a function to delete old dars.Code:1 2 * * 1 /bin/bash /usr/local/sbin/zmbak.sh -f > /var/log/zim_backup.log 2>&1 0 3 * * 2-7 /bin/bash /usr/local/sbin/zmbak.sh -d > /var/log/zim_backup.log 2>&1
Last edited by LaFong; 08-28-2010 at 02:28 PM.
Well, you have to set the diff days in the crontab to Wednesday-Monday, of course. For example:
orCode:1 2 * * 2 /bin/bash /usr/local/sbin/zmbak.sh -f > /var/log/zim_backup.log 2>&1 1 2 * * 1,3-7 /bin/bash /usr/local/sbin/zmbak.sh -d > /var/log/zim_backup.log 2>&1
Code:1 2 * * tue /bin/bash /usr/local/sbin/zmbak.sh -f > /var/log/zim_backup.log 2>&1 1 2 * * mon,wed-sun /bin/bash /usr/local/sbin/zmbak.sh -d > /var/log/zim_backup.log 2>&1I keep two weeks of dars on the sync drive. The dars and the sync directory are also backed up by other software. I figure that's enough.What do you use to delete old dars files?I added a routine to the full backup, discussed here [SOLVED] Yet Another Backup Script for Community Version
Last edited by LaFong; 08-28-2010 at 07:49 PM.
Hi,
I've got a 6.0.6_GA_2324_SLES11_64 and i have problem with zmDBbac.sh I don't know why byt script cannot connect to ldap serwer. Here are logs:
Can anybody tell me what i'm doing wrong ? (besides my english of course# /usr/local/sbin/zmbak.sh -f
============================
Mon Sep 20 06:12:05 CEST 2010
Performing FULL backup
============================
full Backup started at: Mon Sep 20 06:12:05 CEST 2010
No old backups found
No two-week old backups found
Setting date & version Marker into /opt/zimbra/DATE_VERSION.txt
Doing a hotsync of /opt/zimbra/ to /backup/sync/
Disabling the Zimbra crontab...
Stopping the Zimbra server...
Host poczta.ofix.pl
Stopping stats...Done.
Stopping mta...Done.
Stopping spell...Done.
Stopping snmp...Done.
Stopping archiving...Done.
Stopping antivirus...Done.
Stopping antispam...Done.
Stopping imapproxy...Done.
Stopping memcached...Done.
Stopping mailbox...Done.
Stopping logger...Done.
Stopping ldap...Done.
Doing a fast cold sync...
Backing up Zimbra DBs...
Making sure all Zimbra services are stopped...
Starting just LDAP and MySQL for db dump...
Starting LDAP...
Started slapd: pid 28405
Starting MySQL...
Starting mysqld...done.
Trying to connect to MySQL...
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Dumping and processing per-user dbs and exporting per-user LDAP entries...
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
E-Mail User DB LDAP zimbraId
------ ------------ ---- -------
(zimbra) zimbra --
Total users = 1
Dumping raw dbs...
zimbra
mboxgroup1 xxx@xxx.pl
(...)
mboxgroup48 yyy@xxx.pl
Stopping LDAP and MySQL...
Stopping mysqld... done.
Killing slapd with pid 28405 done.
Reinstating Zimbra's crontab...
Starting Zimbra...
Host my.name.pl
Starting ldap...Done.
Starting logger...Done.
Starting mailbox...Done.
Starting antispam...Done.
Starting antivirus...Done.
Starting snmp...Done.
Starting spell...Done.
Starting mta...Done.
Starting stats...Done.
Service down time was - Hr:0 Min:3 Sec:22
Running A hack... This one to check and start Stats subsystem
Hack not needed Stats seems to be running fine...
Writing a full backup: 38_Zimbra_Backup_20-September-2010_FULL
into: /backup/current/ with file sizes of max: 110000M
Saving Unencrtyped Archive...
--------------------------------------------
37921 inode(s) saved
with 731 hard link(s) recorded
0 inode(s) changed at the moment of the backup
0 inode(s) not saved (no inode/file change)
0 inode(s) failed to save (filesystem error)
0 inode(s) ignored (excluded by filters)
0 inode(s) recorded as deleted from reference backup
--------------------------------------------
Total number of inodes considered: 37921
--------------------------------------------
Creating MD5 Checksum for 38_Zimbra_Backup_20-September-2010_FULL.1.dar...
Creating file listing from archive...
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::
full Zimbra Backup ended at: 06:23
Backup took Hr:0 Min:11 Sec:6 to complete
:::::::::::::::Cheers Osoffice for the script:::::::::::::::::::::::)
Are you running the DB backup script as the zimbra user? Try running the LDAP command manually:
1) As root,
2) Set zimbra environment variables:Code:su - zimbra
3) Try an LDAP lookup:Code:source ~/bin/zmshutil ; zmsetvars
This should get you a large LDAP listing. If it fails, check that the environment variables exist:Code:ldapsearch -x -H ldap://"$HOSTNAME" -D "$zimbra_ldap_userdn" -w "$zimbra_ldap_password" '(&(objectClass=zimbraAccount)(!(zimbraIsSystemResource=TRUE)))' zimbraId
Look for the 3 variables used in the ldapsearch command line, the ones with the "$".Code:printenv
If you have any firewall or other method of blocking port 389, that could be problematic, but localhost or local NIC IP should ordinarily have no problems.
Hello,
I have been running the 0.6-version of this script for quite a long time without any problems, but it suddenly stopped working. I do believe this is a cron-problem, so I tried to do a temporary workaround with running the script manually.
This is what happens:
- If I run it as a normal user, I am told to "Run script as root.".
- If I run it as root, I am told that "Zimbra user should never be root!".
- If I run as Zimbra user I am told to "Run script as root.".
I am basically lost here, can anyone please guide me in the right direction?
Oh, by the way, I get the same messages if I try to install the 0.8-version of the script.
Thankyou for any response!
There are currently 2 users browsing this thread. (0 members and 2 guests)