Page 40 of 66 FirstFirst ... 30383940414250 ... LastLast
Results 391 to 400 of 659

Thread: [SOLVED] Yet Another Backup Script for Community Version

  1. #391
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by jetorres View Post
    I think he was asking for a way to change the schedule in the middle of the cycle. If he wants to keep the new cycle he needs to make the suggested "workaround" on the previous post and change the cron jobs settings. He can do that by "reinstalling" the script and removing the old jobs, or manually by editing the cron jobs.
    You are right. I see now that it bases backup week entirely off the full, so he only has to make your proposed changes once. He can continue to use %W for the date, though using %U would be more accurate for his full on Sunday schedule.
    Last edited by LaFong; 08-27-2010 at 06:20 PM.

  2. #392
    agd
    agd is offline Special Member
    Join Date
    Jul 2008
    Location
    Montevideo - Uruguay
    Posts
    106
    Rep Power
    7

    Default

    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

  3. #393
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by agd View Post
    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).
    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.
    Also, this parameter should be changed in:

    BACKUPWEEK=`date +%W`

    or

    date +%W > $BACKUPWEEKFILE
    The first version above should be commented out in your script, i.e. have a "#" in front of it
    Code:
    # BACKUPWEEK=`date +%W`
    That was the older method of setting BACKUPWEEK.

  4. #394
    agd
    agd is offline Special Member
    Join Date
    Jul 2008
    Location
    Montevideo - Uruguay
    Posts
    106
    Rep Power
    7

    Default

    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

  5. #395
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by agd View Post
    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 ?
    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:
    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
    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 * * 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
    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.
    Last edited by LaFong; 08-28-2010 at 02:28 PM.

  6. #396
    agd
    agd is offline Special Member
    Join Date
    Jul 2008
    Location
    Montevideo - Uruguay
    Posts
    106
    Rep Power
    7

    Default

    Quote Originally Posted by LaFong View Post
    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:
    Ok, but if want to run the full every Tuesday and diff the rest of the days, it should work by only changing the crontab of the full day ?

    Quote Originally Posted by LaFong View Post
    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:

    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.
    What do you use to delete old dars files?
    --
    AGD

  7. #397
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by agd View Post
    Ok, but if want to run the full every Tuesday and diff the rest of the days, it should work by only changing the crontab of the full day ?
    Well, you have to set the diff days in the crontab to Wednesday-Monday, of course. For example:
    Code:
    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
    or
    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>&1
    What do you use to delete old dars files?
    I 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. 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.

  8. #398
    macol is offline Beginner Member
    Join Date
    Jun 2010
    Posts
    1
    Rep Power
    5

    Default problem

    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:

    # /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:::::::::::::::::::::::
    Can anybody tell me what i'm doing wrong ? (besides my english of course )

  9. #399
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    Default

    Quote Originally Posted by macol View Post
    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:

    Code:
    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)
    Can anybody tell me what i'm doing wrong ? (besides my english of course )
    Are you running the DB backup script as the zimbra user? Try running the LDAP command manually:
    1) As root,
    Code:
    su - zimbra
    2) Set zimbra environment variables:
    Code:
    source ~/bin/zmshutil ; zmsetvars
    3) Try an LDAP lookup:
    Code:
    ldapsearch -x -H ldap://"$HOSTNAME" -D "$zimbra_ldap_userdn" -w "$zimbra_ldap_password" '(&(objectClass=zimbraAccount)(!(zimbraIsSystemResource=TRUE)))' zimbraId
    This should get you a large LDAP listing. If it fails, check that the environment variables exist:
    Code:
    printenv
    Look for the 3 variables used in the ldapsearch command line, the ones with the "$".
    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.

  10. #400
    primaxx is offline Active Member
    Join Date
    Mar 2009
    Location
    Oslo, Norway
    Posts
    47
    Rep Power
    6

    Default Weird (for me) problem regarding root

    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!

Page 40 of 66 FirstFirst ... 30383940414250 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 08:40 AM
  2. Debian - Upgrade from 4.5.6
    By magikman in forum Installation
    Replies: 1
    Last Post: 01-19-2008, 12:59 PM
  3. Backup script issues
    By SSS in forum Administrators
    Replies: 18
    Last Post: 12-03-2007, 09:56 AM
  4. 4.0.4 to 4.5.6 upgrade failed in network edition
    By chenthil in forum Administrators
    Replies: 1
    Last Post: 08-27-2007, 09:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 09:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •