Operating System - HP-UX
1833059 Members
2587 Online
110049 Solutions
New Discussion

Writing program to automate backup.

 
Mick Terragrossa
Occasional Contributor

Writing program to automate backup.

I'm working in HP-ux 11.0 and I need to start a backup program nightly at a time when no one is in the building. I already have a program called bkcubs that I start manually which uses fbackup and works well. I would like to design a program to run bkcubs at midnight every night. Can anyone tell me how to do that?
6 REPLIES 6
CA628575
Trusted Contributor

Re: Writing program to automate backup.

A service for this is built into Unix (including HP-UX). Look up the documentation for cron and crontab.
BR19682
Esteemed Contributor

Re: Writing program to automate backup.

Hi there.
I think, that you work as sysadmin and you have got the root access.

Here a little script, that will help you to change your crontab settings :
--------------------------------------
#!/bin/sh
cd /var/tmp
# reading out crontab for user
crontab -l > crontab.root
# editing the file
vi crontab.root
# reading in contents to crontab
crontab crontab.root
--------------------------------------------

explanation of crontab line :

############################################################
# Minute Hour Month-Day Month Weekday Command #
# _________________________________________________________#
############################################################
#################
# OmniBack II
#################

0,15,30,45 * * * * /opt/omni/sbin/omnitrig
00 01 * * 1-5 /usr/local/bin/bkcubs # suggested
00 01 * * 6 /usr/local/bin/bkcubs # suggested
---------------------------------------------

Hope, that will help
Rgds
Alexander M. Ermes


.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
CA612148
Occasional Advisor

Re: Writing program to automate backup.

Mick,

You don't even have to go through all of the steps listed above. You can just type "crontab -e root" to edit the crontab. That will bring you into a VI session to edit the crontab and move it into place when you are done. The format of the file is as described above. If you don't want your jobs to run as root, substitute anyone's user id instead of root.

--Joe
Mick Terragrossa
Occasional Contributor

Re: Writing program to automate backup.

Thank you to all the reply's. I had heard there was a utility for this and your help pointed me in the right direction.!
Li_7
New Member

Re: Writing program to automate backup.

I use SAM to set up my backup. It is SAM -> Backup and Recovery -> Automated Backups -> Add an Automated Backups
LEE
Bill Earley
New Member

Re: Writing program to automate backup.

Mick: cron job can fail because $PATH is limited. You may need to add the statement
PATH=$PATH:/a/b:/x/y
to your script. cron will send errors as mail to the cronfile owner (root), or you can add
/x/y/bkups > /tmp/bkups.log 2>&1
Do this until things are working, then normally you change the call to:
/x/y/bkups > /dev/null
Errors will still get mailed.