cancel
Showing results for 
Search instead for 
Did you mean: 

How can I alternate full and incremental backups?

sclind
Moderator
Moderator
   VIP   

Currently I have a policy where I run a full backup three days a week and an incremental four days a week (the days are hardcoded in the schedules).

I tried setting up a test policy with the full backup to run every 2 days at 10 am.  And then I also defined a incremental schedule to run every 2 days at 10 am.   When the policy ran for the first time (yesterday) it ran the full backup (as expected).

I hoped to see that the incremental schedule would have then run today but it didnt.

Anyone have any ideas on how to alternate full and incrementals every other day?

44 REPLIES 44

revarooo
Level 6
Employee

Shame, I have a quick solution for unix but it won't work for Windows.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

You still haven't answered Andy's question. Why do you need this?

sclind
Moderator
Moderator
   VIP   

Riann - I don't know what more I can say other than this meets our needs.  We dont need a full backup everyday.  (Why does it matter *why* I need this?)

sclind
Moderator
Moderator
   VIP   

Revaroo - I will actually be moving the Windows media server that does these backups to Linux.  Does that help?

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

In some cases more information about the actual requirement can help with the solution. If you have a headache and you walk into the pharmacy and ask for stomach pills that won't help... Sometimes forum users are not telling us why and it leads to many days of information exchange which leads to nothing.

 

We cant make assumptions on your level of expertise with NetBackup :)

 

So, does a cumulative incremental not suffice? What about Synthetic backups maybe?

 

 

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Ok, try this

 

One FULL Schedule - 1 Day Freq

Open the window for

Monday

Wednesday

Friday

 

One INCR Schedule - 1 Day Freq

Open the window for

Tuesday

Thursday

Saturday

 

If you want Sunday too you'll need to stick it in either one.

sclind
Moderator
Moderator
   VIP   

Riann - that is what I am currently doing. 

sclind
Moderator
Moderator
   VIP   

We would not want to take the restore time [potentially] needed by a cumulative backup (if for example we did a full once a week and cumulative incrementals the rest of the week).

We do tape backups; I am not familar with how synthetic backups fit into that.

RiaanBadenhorst
Moderator
Moderator
Partner    VIP    Accredited Certified

Your output lists 2 day frequency, and the windows are open for both schedules everyday. Its not the same?

sclind
Moderator
Moderator
   VIP   

Riaan - I was hoping that Netbackup would know to do the Full every 2nd day and the Incremental every [other] 2nd day.  But that is not happening.

What you had suggested would have me doing an incremental on both Saturday and Sunday, or a Full on both Sunday and Monday.

revarooo
Level 6
Employee

See my solution for unix above. Won't work with Windows though (unless you install something like Cygwin with cron installed)

sclind
Moderator
Moderator
   VIP   

I may give that a  try after I convert to Linux.  Thanks!

Andy_Welburn
Level 6

You could try a variation of the following, which would not 'break' if you manually run a backup (per revarooo's earlier concern) as it could be set up such that it runs fulls on odd days of the year (1,3,5,...,35,... etc etc) and incrementals on even days (altho' you'd still get 2 fulls at the end/beginning of the year - day 365 & day 1)

Essentially you would cron a script to run every day, then, depending on the day of year check, it would run the appropriate backup.

 

http://sysunconfig.net/aixtips/cron_trick.txt

 

(... just a little thing I found the other week that could've come in handy many times over the years!)

revarooo
Level 6
Employee

Good thinking Andy. Use the dates as odd and evens to determine when a FULL and INC schedule for a policy should be run. This will only not do the FULL on the next day when there are 31 days in the month. If you want TRUE every other day, use my other solution above.

 

 

 

#!/bin/bash
date=`/bin/date +%d`

VAL=$(( $date% 2 ))

if [ $VAL -eq 0 ]
then
/usr/openv/netbackup/bin/bpbackup -i -p <policy> -s FULL   #if day is even run a FULL backup
else
/usr/openv/netbackup/bin/bpbackup -i -p <policy> -s INC    # if day is odd run a INCREMENTAL backup
fi

 

Another solution to make it work every other day, is have two crontab templates. add the FULL and INC in 1 template as:

FULL: Mon, Wed, Fri, Sun

INC: Tue, Thu, Sat

then have a script run via crontab on the sunday at night to flip the crontab file for each other for root to have FULL and INCs run as

FULL: Tue, Thu Sat

INCL Mon, Wed, Thu, Sat

Messy, but would work too. I prefer my first method earlier in this thread

Will_Restore
Level 6

How about using  `/bin/date +%j`

( julian day of year )

Andy_Welburn
Level 6

Thanks Will - I honestly thought that was already in the link (hence my reference to odd/even days up to 365) but it isn't!

sclind
Moderator
Moderator
   VIP   

I just decided to go with calendar scheduling - I will do full backups on even days of the month and incrementals on odd days of the month.  Not my 'ideal' solution but gets me closer than I am now,

Thanks for all the ideas!

revarooo
Level 6
Employee

No prob. If you ever do go with a Unix master in the future and need to alternate FULL and INCs daily, you can refer back to the ideas posted here.

Please select one of the answers as Solution to complete this thread.

Marianne
Level 6
Partner    VIP    Accredited Certified

Symantec generally listen to customers and introduce enhancements when there is large enough request for it. That is why calendar scheduling was introduced a couple of years ago.
The scheduling in NBU is good enough for about 99.9% of users all over the world.

Users who can afford the backup window and resources do Full backups every day.
Those who can't do Fulls over a weekend and Incr during the week (last Full + last Cum Incr is all that they need for restore.
A handful of users stagger the Fulls. 
NBU scheduling is sufficient for all of these requirements.

The users who are not happy with NBU scheduling invest in a 3rd-party scheduler.

If you want to go through the trouble of requesting enhancement from Symantec, you can use the Ideas section of Connect. 
Users who agree with the request will vote for your Idea.

Genericus
Moderator
Moderator
   VIP   

Why don't you set up two user schedules - one full and one incremental. They can run at anytime.

Run the same script every day.

Step 1 - list the last backup completed.

Step 2 - If the last backup is full, call the incremental. If the last backup is incremental, call the full.

This way, you don't need to worry about dates, and it will be based on the last successfull backup.

NetBackup 9.1.0.1 on Solaris 11, writing to Data Domain 9800 7.7.4.0
duplicating via SLP to LTO5 & LTO8 in SL8500 via ACSLS