cancel
Showing results for 
Search instead for 
Did you mean: 

How would I set up a scheduled and scripted backup?

Michael_Kaish1
Level 4
Hi

Master Server: NBU 6.0MP3 w/ Windows 2003 Standard Edition SP1
Client: Windows 2003 Standard Edition SP1

Situation: I would like to set up a backup policy to backup the client machine. The policy would be scheduled; however the backup would not kick off until a trigger file exists. The trigger file would be created by a process and would be called startbackup.txt. I would like to have the policy keep looking for the startbackup.txt file and once the file exists I would like the backup to kick off and start backing up the client. How would I script this? How would I set it up in bpstart_notify? Would you be able to point me to some helpful links?

Thanks in advance
8 REPLIES 8

Chia_Tan_Beng
Level 6
Hi Michael,

Instead of getting netbackup to check for the trigger file, is it acceptable to let the triggering process to initiate the backup by executing bpbackup command? In my opinion it is cleaner.

bpbackup
]
]
-f listfile | filenames

Nathan_Kippen
Level 6
Certified
maybe have cron (if this is a unix box) or task scheduler run a script/batch jobs that checks every X minutes to see if the file exists and if it does then run the bpbackup command...

zippy
Level 6
Michael,

You have to have some sort of scheduler program to kick off your backup, like Nathan said. There are different forms of job scheduling.

Example>

Cron (client based)
At (client based)
Tivoli Maestro or TWS (Master controled, Client based scheduler)
Sun Grid Engine

http://www.google.com/search?hl=en&lr=&q=job+scheduler+batch

You have a choice, you can kick it off from the master via a sceduled batch command, or you can kick it off from the client via a scheduled batch command.



Master UNIX server running a NT server backup from the UNIX Master.

I'm sure you can convert this to Windows batch action stuff.

----------- Cut Here ----------------------------
#!/bin/sh
#
echo "...Starting NT_server..$(date)..."

if ];then
SCHEDULE="Full"
else
SCHEDULE="Incr"
fi
/usr/openv/netbackup/bin/bpbackup \
-i \
-s $SCHEDULE \
-c NT_server \
-w
RC=$?

echo "...Ending NT_server backup..$(date)..."

echo "`date` # $RC # backup_NT_SERVER" >> /tools/tmp/backup.log

if ];then
exit 0
exit $RC
else
exit 0
fi


----------- Cut Here ----------------------------

JD

Michael_Kaish1
Level 4
Hi

The bpbackup would also require some kind of automatic backup set up. For example I cannot set up a user initated backup on the master server unless there is an automatic backup configured. Is there a way to set up a user initated backup only?

Thanks

Mike

P.S. I was thinking of this:
create a bpstart_notify.jobname1.bat then create a policy and call it jobname1. When the policy kicks off the bpstart_notify.jobname1.bat would kick in. Here's what I am thinking of putting inside the BATCH FILE:
---------begin script---------------------------------------------------------
@echo OFF
:LOOP
if exist \\servername\sharename\filename.txt goto EOF
goto LOOP
:EOF
-----------------------------------------------------------------------------------

The jobname1 would be scheduled at a certain time and the bpstart_notify.jobname1.bat would LOOP infinitely until the filename.txt exists and then the script would exit. What do you think?

Thanks in advance

Isidro_Rodrig1
Level 3
Looks alright. You may want to put a sleep in the script so it does not work so much...also look at BPSTART_TIMEOUT since the backup may timeout before the file is created.

Michael_Kaish1
Level 4
Yes the bpstart might time out before the file is created. This file is automatically created by a batch process and sometimes the batch process might take longer than expected. Is there a way to put an infinite time out for bpstart?

Thanks in advance

Chia_Tan_Beng
Level 6
> Is there a way to put an infinite time out for bpstart?

You can insert the following into bp.conf to change the default bpstart timeout:
BPSTART_TIMEOUT = XXX where XXX is in sceond.

I haven't try setting XXX as 0 to see whether its equivalent to infinity. However you may not want to set it for too long as when the pre-backup script hangs for whatever reason, you backup jobs' going to delay.

DavidParker
Level 6
> Is there a
> way to set up a user initated backup only?
>

Absolutely, just create a policy where the only schedule is of 'User' type. Give the schedule a 24 hour window 7 days a week. When you call bpbackup from the client you can pass in the policy and schedule names via flags.

$0.02