Page 39 of 66 FirstFirst ... 29373839404149 ... LastLast
Results 381 to 390 of 659

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

  1. #381
    Join Date
    Apr 2009
    Posts
    22
    Rep Power
    6

    Default Code change as promise

    Quote Originally Posted by jetorres View Post
    The drive is an Iomega NAS drive that is mounted using CIFS drivers.

    I already added a section using cp instead of scp to copy the files to the NAS drive mounted. By now, it did not failed, running the script off schedule. So the problem might be fix by using cp instead of scp. I have to wait to my weekly schedule, to run it at the same time the problem arises. If it runs fine during the normal schedule I will consider it solve.

    Even though is fairly simple, I will post the code changes, after I am sure it solves my problem. Maybe someone else could benefit.
    During my weekly schedule, the full backup run without errors, as well as the differential backup. So I think that the change from scp to cp solved my problem. Still do not know why the scp fails, but the work around will sufice.

    So as promise I will post the code changes:

    Code:
    #--- LOCAL COPY ---# #ADDED CONFIGURATION VARIABLES
    # This option will assist in coping your archives to the same server to external mount drive 
    LCCP="yes"		# valid answers are "yes" or "no" 
    LCDIR="/media/iomega/iomega-005d42/server/ZimbraBackup"	# where you want your backups saved.
    
    #--- LOCAL COPY ---# #ADDED SECTION
    if [ "$LCCP" = "yes" ]
    	then
        	    for CPNAME in `ls -A "$ARCHIVENAME"*`
    	    do
    		SCPRC=0
    	    	echo "copy archive or checksum $CPNAME to directory $LCDIR"
    	    	cp $CPNAME $LCDIR
    	    	SCPRC=$?
    	    	if [ "$SCPRC" -ne "0" ]
    	      	then
    		    #echo "Error copying archive and checksum to $REMOTEHOST"
    		    echo "Error copying archive or checksum to $LCDIR"
    		    mail_log
    		    exit 1
                  fi
    	    done
               if [ "$SCPRC" -ne "0" ]
    	      then
    		    #echo "Error copying archive and checksum to $REMOTEHOST"
    		    echo "Error copying archive or checksum to $LCDIR"
    		    mail_log
    		    exit 1
                  elif [ $TYPE = "full" ] #Code to remove previous week backup on LCDIR after completing the transfer
                  then
    		     rm -f "$LCDIR"/"$LAST_FULL_WEEK"_"$BACKUPNAME"*
               fi    
    	fi

  2. #382
    Join Date
    Jul 2008
    Location
    Montevideo - Uruguay
    Posts
    106
    Rep Power
    7

    Default Change backup schedule

    Hello.

    It's possible to change the backup schedule ?
    Instead of making the full job on Monday do it on Sunday.

    I changed the cron configuration but on Monday the script did the full again because didn't find the full for this week.

    Thanks.
    Regards.
    --
    AGD

  3. #383
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    7

    Default

    Quote Originally Posted by agd View Post
    Hello.

    It's possible to change the backup schedule ?
    Instead of making the full job on Monday do it on Sunday.

    I changed the cron configuration but on Monday the script did the full again because didn't find the full for this week.

    Yes. Change the BACKUPWEEKFILE date line:
    Code:
    date +%W > $BACKUPWEEKFILE
    You will want the %U option. I use %V myself, because it works better for end of year issues. If you wanted both ISO week and Sunday as first day, you'd need to add some code.

    Code:
           %U     week number of year, with Sunday as first day of week (00..53)
    
           %V     ISO week number, with Monday as first day of week (01..53)
    
           %W     week number of year, with Monday as first day of week (00..53)

  4. #384
    Join Date
    Apr 2009
    Posts
    22
    Rep Power
    6

    Default Are you using the last script version?

    Quote Originally Posted by agd View Post
    Hello.

    It's possible to change the backup schedule ?
    Instead of making the full job on Monday do it on Sunday.

    I changed the cron configuration but on Monday the script did the full again because didn't find the full for this week.

    Thanks.
    Regards.
    I am not sure which is the last version, but at least version 0.8 of the script does give you the oportunity to make the schedule start on a different date of week than Monday.

    If you want to change the Full schedule ones started without removing the current Full set, then is another question.

  5. #385
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    7

    Default

    Quote Originally Posted by jetorres View Post
    I am not sure which is the last version, but at least version 0.8 of the script does give you the oportunity to make the schedule start on a different date of week than Monday.
    In a quick scan of the 0.8 version, I do not see this capability built-in. Where do you see it?

  6. #386
    Join Date
    Jul 2008
    Location
    Montevideo - Uruguay
    Posts
    106
    Rep Power
    7

    Default

    Yes, that what I need. Thanks !!
    --
    AGD

  7. #387
    Join Date
    Apr 2009
    Posts
    22
    Rep Power
    6

    Default Rotation week start change

    Quote Originally Posted by LaFong View Post
    In a quick scan of the 0.8 version, I do not see this capability built-in. Where do you see it?
    # BACKUPWEEK=`date +%W` # Week prefix used for backup weekly rotation and naming
    # VJS - Commented out above, and added below to allow Weekly baseline to be any day of week.
    # Needs full set of tests to be run, including archiving old weeks data, etc.
    BACKUPWEEKFILE="/opt/zimbra/backup.week"

    By means of this file the week schedule can be started in the middle of the week and when the actual week changes it ignores the change until the next Full type backup.

  8. #388
    Join Date
    Apr 2009
    Posts
    22
    Rep Power
    6

    Default Hack the week starting day

    Quote Originally Posted by agd View Post
    Yes, that what I need. Thanks !!
    # BACKUPWEEK=`date +%W` # Week prefix used for backup weekly rotation and naming
    # VJS - Commented out above, and added below to allow Weekly baseline to be any day of week.
    # Needs full set of tests to be run, including archiving old weeks data, etc.
    BACKUPWEEKFILE="/opt/zimbra/backup.week"

    Rename your full type backup week number and look for the backup.week file and edit the value accordingly to the desired week number. The differentials already made using the full type backup that you rename, yo umay leave them as is but you can also rename accordingly.

    What you can't have are more than one Full type backups.

  9. #389
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    7

    Default

    Quote Originally Posted by jetorres View Post
    Rename your full type backup week number and look for the backup.week file and edit the value accordingly to the desired week number. The differentials already made using the full type backup that you rename, yo umay leave them as is but you can also rename accordingly.

    What you can't have are more than one Full type backups.
    Ah, yes that will work best as a workaround, probably only used once. I think he was asking for a permanent schedule shift.

  10. #390
    Join Date
    Apr 2009
    Posts
    22
    Rep Power
    6

    Default For permanent change, also change the cron schedule

    Quote Originally Posted by LaFong View Post
    Ah, yes that will work best as a workaround, probably only used once. I think he was asking for a permanent schedule shift.
    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.

    If he has Webmin installed, its very easy to change the jobs.

Similar Threads

  1. Zimbra Backup Script ... Small Problem
    By frankb in forum Administrators
    Replies: 12
    Last Post: 07-14-2008, 09: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, 10:36 AM
  5. [SOLVED] Simple backup question...
    By dameron in forum Administrators
    Replies: 3
    Last Post: 08-25-2007, 10: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
  •