Operating System - OpenVMS
1829585 Members
2603 Online
109992 Solutions
New Discussion

Re: Script Full and incremental backup

 
geir_2
Super Advisor

Script Full and incremental backup

Hi,

I want to make a DCL-script for incremental backup. I know that backup have a qualifier called /since=backup and /record which is essential.

I want to take monhly, weekly and daily backup. If I want to restore files from a particular period, what must I do. Any idea??

Thanks Geir


PS:
I'm running OpenVMS ALPHA V6.2-IH3. I know it's old, but it is not possible to upgrade the operating system.
16 REPLIES 16
Mike Reznak
Trusted Contributor

Re: Script Full and incremental backup

Hi,

in case of '/since=backup and /record' I assume it'll backup only files modified or created since last backup.
For specific period of time is the best to use /SINCE="TODAY-7-" or just "-7-", that means past 7 days together with qualifiers /MODIFIED /CREATED which selects only modified or created files in that period.
In restore operations either extract all files from specific save set or use /SELECT for specific files.

Mike
...and I think to myself, what a wonderful world ;o)
geir_2
Super Advisor

Re: Script Full and incremental backup

Hi,

Thanks for the answer, but then I must run the command manually.

I want to include it into a DCL-script, and let it run automatically in a batch job.

I think I must use one tape for each month, one for each week, and one for each year.

Geir
Mike Reznak
Trusted Contributor

Re: Script Full and incremental backup

If you have tape library with dozens or hundreds of tapes then regular batch job with different tapes is the best solution. Different jobs can call one procedure with different parameters, which tell, what period of time to backup and then it chooses specific tape. If you have just single tape drive, then you can either backup all types of backups on one tape or keep switching tapes, which is rather not suitable for regular batch processing.
Allways keep journal files with /JOURNAL='file' to know, what files were backuped.

M
...and I think to myself, what a wonderful world ;o)
Lawrence Czlapinski
Trusted Contributor

Re: Script Full and incremental backup

geir:
1. We do weekly full backups ($BACKUP/IMAGE/RECORD). The first weekly backup is our monthly backup.
2. For daily backups, I recommend cumulative incremental backups. On most of our systems our daily backups are culmulative incremental $BACKUP. [We have a couple systems that we do full daily backups on.] This way files created since the last backup are often on more than one tape except those not on the previous incremental tape. Our January monthly is a permanent archive.
If you want to restore files since the last the full backup, you can use the the cumulative incremental backup tape.
You could do non-cumulative incremental backups but then you have to know what day the file was changed last. If a disk went bad and the tape also had a problem, you would lose all the changes and new files for that day.
Lawrence
David Jones_21
Trusted Contributor

Re: Script Full and incremental backup

I take monthly fulls and daily incrementals and use saveset manager to make a cumulative incremental. I keep the 2 most recent incrementals and 2 most recent cumulative incrementals.

Attached is a procedure I wrote to scan the disks and report the backup dates on the volume, both last full and last incremental.
I'm looking for marbles all day long.
Ian Miller.
Honored Contributor

Re: Script Full and incremental backup

David, parhaps you could contribute your DCL to dcl.openvms.org?

Also when attaching DCL here its easiest if you name them .txt to prevent web browsers making incorrect asummptions about file contents based on the .com
____________________
Purely Personal Opinion
Petr Spisek
Regular Advisor

Re: Script Full and incremental backup

Hallo geir,
if disk dies, you must restore the last full backup and all increments from last full backup which you have.
For particular period you must to do the same to the period.
For restore specific file use /JOURNAL for easiest finding where the increment-saveset with the file is.

Next idea is: use some backup manager for this (ABS or Data Protector)
Petr
Ian Miller.
Honored Contributor

Re: Script Full and incremental backup

this article
http://h71000.www7.hp.com/openvms/journal/v3/backup_strategies.html

is always worth reading when considering backup strategies. The main thing to consider what you want to be able restore then only backup those files :-)
____________________
Purely Personal Opinion
geir_2
Super Advisor

Re: Script Full and incremental backup

Hi,

Is it possible to get daynumber of the year from a DCL shell script??

Regards geir
David Jones_21
Trusted Contributor

Re: Script Full and incremental backup


"Is it possible to get daynumber of the year from a DCL shell script??"

$ now = f$time()
$ doy = f$cvtime(now,,"DAYOFYEAR")
I'm looking for marbles all day long.
Joseph Huber_1
Honored Contributor

Re: Script Full and incremental backup

A very simple one is the following loop, just counting from 1-JAN until today:

$ today_time = f$cvtime("TODAY") !time string at midnight today
$ i = 1
$more_days:
$ if f$cvtime("1-JAN:+"+f$string(i)+"-",,).les.today_time
$ then
$ i = i + 1
$ goto more_days
$ endif
$ write sys$output 'i'
http://www.mpp.mpg.de/~huber
Joseph Huber_1
Honored Contributor

Re: Script Full and incremental backup

Davids answer is superior of course.
Sometime I have to get the time to read "new features" manuals carefully: back to which VMS version is the DAYOFYEAR item available ?
http://www.mpp.mpg.de/~huber
David Jones_21
Trusted Contributor

Re: Script Full and incremental backup

"Sometime I have to get the time to read "new features" manuals carefully: back to which VMS version is the DAYOFYEAR item available ?"

I first saw it after the 8.2 upgrade, it's probably post 7.3.

Another way to calculate it, without loops:
$! JanFebMar AprMay Jun Jul Aug Sep Oct Nov Dec
$ month_day_offset = "0/0/31/59/90/120/151/181/212/243/273/304/334/365"
$ cdate = f$cvtime(test_date,"COMPARISON","DATE")
$ year = f$element(0,"-",cdate)
$ mnum = f$integer(f$element(1,"-",cdate))
$ doy = f$integer(f$element(2,"-",cdate)) + -
f$integer(f$element(mnum,"/",month_day_offset))
$! correct doy for leap years.
$ if f$extract(0,1,f$cvtime("28-FEB-''year':12:00+1-00:00","ABSOLUTE")) -
.eqs. 2 then doy = doy + 1
I'm looking for marbles all day long.
geir_2
Super Advisor

Re: Script Full and incremental backup

Hi everyone,

The reason for the incremtnal backup problems is that some gay on my job, expect/want me to make a incremental backup script. Today we take full backup each day, with help from a backup script. The tape rotate every week, and at the end of the month we take full backup.

I asked the gay, why he want to take incremental backup, since we backup every file each dat. He told me that if he delete a file in the middle of the week, the new backup will overwrite the file with new contents. And with incremental backup, he have at least some more days to regret the deltion of the file.

So now I try to make a backup com file, that start the week on monday with full backup, and the next 6-days take incremental backup(on the same tape). Next monday with new week backup and incremental backups etc.

I think a good solutions would be four week week tapes, and one month backup tape for each system. I also think that if I could start the tape backup with full backup, and later incremental backups (/norewind).

If some of you had comments, it would be great. If you some of you want to read the backup script we use today, and want to improve it,(for use with incrmental backup) it would be nice.


Thanks Geir
Willem Grooters
Honored Contributor

Re: Script Full and incremental backup

Geir,

is not the solution. It will speed up the backup procedure if a full backup would take too much time (esapcially when just a few files are actually updated), but even that may cause a problem in restore.
The most basic point is to give the daily saveset a unique name (based on date)

$ BACKUP :[...]*.*;* :yymmdd.bck

and on restore, you use the /SELECT qualifier in restoring just that file:

$ BACKUP :yymmdd.bck/saveset /SELECT= :[]

regardless you made an incremental backup or a full one.

I think it will work as well when a full image backup has been done in stead of a file-by-file one:
$ BACKUP/IMAGE : :yymmdd.bck/SAVE_SET

Willem
Willem Grooters
OpenVMS Developer & System Manager
geir_2
Super Advisor

Re: Script Full and incremental backup

Willem,

Thanks for the answer. Do you also think I should make more savesets on a tape, and use the /norwind qualifier? Or would it be the best solutions to have a tape for each save set?

Thanks,

Geir