Link to home
Start Free TrialLog in
Avatar of Wiltshire
WiltshireFlag for Australia

asked on

How do I create a differently-named backup of a single file for each day?

I have a site that is running Small Business Server using Acronis True Image ECHO Server for its daily backups. They work fine.

However, I need to do a daily backup of a single (non-database) file - but I need each backup file to be of a different name so that I can go back to a particular backup from weeks/months ago if I need to.

The backup drive is a huge USB external disk and it is unlikely that ten thousand copies of the single file would fill up the drive.

I can't see a way of doing this in Acronis True Image, as it normally does either full or incremental backups.

Is there a simple solution, such as creating a batch file that simply copies the file to the backup drive with the current date as part of the file name? The batch file could then be added as a scheduled task.

Any suggestions would be appreciated.
Avatar of Missus Miss_Sellaneus
Missus Miss_Sellaneus
Flag of United States of America image

You can write a batch file to run daily after the backup with one line:

(example filename of dailyfile.ext)

REN z:\backupfiles\dailyfile.ext dailyfile%date%.ext
To use the above, you'll need to make sure your default date format is file-name friendly. If your default date format has slashes in it, it won't work. You can change your default date format to dashes instead of slashes, ie. 24-05-2008.
Avatar of powercram
powercram

To copy the file with the date in the name would be as simple as:
   copy <source>:\file.ext <dest>:\file_%date%.ext

Except that the variable, %date% would look like 05/23/2008 which wouldn't work because "/" cannot be used in a file name.  So, you could use the following to remove "/" from the variable.
   set DT=%DATE%

   set DT=%DT:/=%   ; this will remove the / from the date
   copy <source>:\file.ext <dest>:\file_%dt%.ext

Avatar of Wiltshire

ASKER

That looks like a good solution.

Would that be the complete contents of the batch file?

....

   set DT=%DATE%

   set DT=%DT:/=%   ; this will remove the / from the date
   copy <source>:\file.ext <dest>:\file_%dt%.ext

....

Do I need to change the date format back afterwards, or will it only effect the file in question for this one instance?

Above batch methods are good.
Or, check out realdate.com
http://www.huweb.hu/maques/realdate.htm
with examples and links to other methods
ASKER CERTIFIED SOLUTION
Avatar of junglecom
junglecom
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's a great idea junglecom. You've hit the nail on the head. It will work as long as the archive file doesn't split into 2 or more. if it splits, the file name would then be MyBackup66081, MyBackup66082, etc, which (to Acronis True Image) is an invalid file name. i guess the solution is to simply insert an underscore between the date and where the split archive number is generated. Eg. MyBackup[date]_

Yeah your are right a _  will solve that!
You can alway make sure it does not split. Since it is one file i see no need to split the archives.
Damn! I just tried the solution and it didn't give me the result I had hoped for.

I created a scheduled task in Acronis True Image Server (9.1) and set it to make a file called AuditFilebackup[date]_.tib each day.

Unfortunately, it did exactly that. It created a file called AuditFilebackup[date]_.tib. Not AuditFilebackup16608_.tib, AuditFilebackup17608_.tib as I thought it might.

Can anyone help me with this?
As a further note, I provided the solution from junglecom to Acronis Tech Support. They said that it couldn't be done.
That is weird. Mine works just fine. Works without the _ and with. Perhaps you can try Audit[date]Filebackup.tib

Let me know how it goes.
I have just tried inserting [date] into every combination of filename I could think of. They all inserted the date.

Perhaps you are missing a step. What build of Acronis are you using? 8076?
If you talked to Acronis Support (the russian guys) chances are they do not know about this little trick. It is not documented in their support database that they read off of religiously. As long as you have build 8076, it will work. I cannot claim the same for earlier builds as I do not have them for testing.