Operating System - HP-UX
1833758 Members
2865 Online
110063 Solutions
New Discussion

How to add time to backup files?

 
Kevin.Wang
Frequent Advisor

How to add time to backup files?

I backup files as below,
fackup -f /backup/oracle.app -0vi /u01

Can I add time to the file oracle.app?
I hope the output file has the format like oracle.app.20030620.

can you help me?
4 REPLIES 4
Con O'Kelly
Honored Contributor

Re: How to add time to backup files?

You can use the date command
# date "+%Y%m%d"

Probably best to set in variable as in:
#BKUP_DATE=$(date "+%Y%m%d")

Then use as follows:
/backup/oracle.app.${BKUP_DATE}

I would probably write a short script to do your fbackup and define the variable in the script.

Cheers
Con
twang
Honored Contributor

Re: How to add time to backup files?

Try this command,
# fbackup -f /backup/oracle.app.`date '+%y%m%d'` -0vi /u01
Michael Tully
Honored Contributor

Re: How to add time to backup files?

Have a look at this fbackup script. It should do everything you need.

Regards
Michael

BTW: You should also make sure that you assign points to people who assist you. It is in the spirit and etiquette of the forums to do so.



Anyone for a Mutiny ?
Kevin.Wang
Frequent Advisor

Re: How to add time to backup files?

# crontab -l
59 23 * * 5 /backuporadata/backu01
59 23 * * 6 /backuporadata/backu03

# more /backuporadata/backu03
fbackup -f /dev/rmt/0mn -0i /u03
# more /backuporadata/backu01
fbackup -f /backuporadata/oracle.app.`date '+20%y%m%d'` -0i /u01
#