PDA

View Full Version : Command file to rename scheduled backups


shieber
April 17th, 2006, 08:43 PM
Does anyone have a command file that can be run as a post command to uniquely rename scheduled backups, like maybe append a date-string to the name or something like that, so that scheduled backups don't keep overwriting.

Thanks,
sh

Menorcaman
April 20th, 2006, 11:09 AM
-{ Quote: "Does anyone have a command file that can be run as a post command to uniquely rename scheduled backups, like maybe append a date-string to the name or something like that, so that scheduled backups don't keep overwriting.

Thanks,
sh" }-Hi shieber,

Perhaps one of MiniMax's suggestions in these two earlier threads could be suitably adapted/utilised:

<variables in backup name> (http://www.wilderssecurity.com/showthread.php?t=78404)
<Automating Acronis Backups using Windows Script files> (http://www.wilderssecurity.com/showthread.php?t=84540)

Regards

shieber
April 20th, 2006, 12:34 PM
Yes, I finally got the batch file right. So that's basically what I'm doing. Putting the date, parsed, into environment variable as a string and then appending that to the filename.

I did run into a little inconvenince though. IF verify after backup is turned on, then Verify runs after the post command. That means it won't find the file because the post command changed the name. However, since ATI runs the post command before the verify, it won't allow the post command to rename the file, presumably because it's held open so for the upcoming verify. I can only assume that Minimax assumed that verify-after-backup would be turned off.

It works if the verify-after-backup is turned off -- but that seeems a shame. I'd like to runthe post command after the verify.

sh

TonioRoffo
April 20th, 2006, 12:42 PM
Another method is using different maps for your backups, and using sysinternals "junction" - point another map towards one of these maps.

Junction can be regarded as hard-links for NTFS.

So you have a map

C:\backup

and using batch commands you can junction this backup map so it points to c:\backupJan or C:\backupFeb or C:\backupWeek5... without the need for more backup jobs, or renaming - you'll just need a way for your batch to point to the right map at the right time...

Renaming isn't the way to go if you need incremental BU's, it won't find your main backup anymore...

shieber
April 20th, 2006, 12:53 PM
Thanks. As I see it, it's not that renaming is a problem, I can rename, I just can 't have the Verify auto run. Maybe I need to put verify into some kind of batch job.

We were going to set up diff directories for diff daily backups but it was rather onerous to have a months worth of commands runnign a month's worth of batchfiles. I'm not sure finding using an external to change the directory (changing the target filemanem?) will help much.

What I have is basically an elegant 4 line batch file that stores the date, checks for the backup, removes any old file with the same date already attached, and renames the new backup file. filenames are unique for a month and then overwrite so that I don't run out of space. I could have made them unique for a year or for forever, but I don't need backups that long but I need them everyday.

sh

Menorcaman
April 20th, 2006, 01:37 PM
-{ Quote: "I can only assume that Minimax assumed that verify-after-backup would be turned off." }-The verify-after-backup (or restore) feature and Pre/Post commands were first introduced in TI 9. However, MiniMax's posts are dated May and June 2005, which pre-dates TI 9 by a country mile :).

Regards

shieber
April 20th, 2006, 02:31 PM
In the scheduled tasks youe mean? Could be. I didn't have need to use them before this week.

sh

Menorcaman
April 21st, 2006, 03:50 AM
-{ Quote: "In the scheduled tasks youe mean? Could be." }-Yes. Prior to TI 9.0, the only thing you could accomplish via the task scheduler was basic disk/partition image creation.

Regards

Howard Kaikow
April 21st, 2006, 05:25 AM
-{ Quote: "Does anyone have a command file that can be run as a post command to uniquely rename scheduled backups, like maybe append a date-string to the name or something like that, so that scheduled backups don't keep overwriting.

Thanks,
sh" }-

Renaming the files AFTER the fact might cause a problem with incremental/differential backs, depending on how TI implements things.

If their implementation is robust, then there should be an encoding of the filename within the incremental/differential files.

However, there's no reason to be concerned, as we can always change the filename BEFORE a task runs.

I was thinking of producing a program for just this purpose.

Would that do what the OP is requesting?