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.
StorageServer Hardware

Avatar of undefined
Last Comment
junglecom

8/22/2022 - Mon
Missus Miss_Sellaneus

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
Missus Miss_Sellaneus

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.
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

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
ASKER
Wiltshire

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?

maques

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
junglecom

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
Wiltshire

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]_

Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
junglecom

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.
ASKER
Wiltshire

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?
ASKER
Wiltshire

As a further note, I provided the solution from junglecom to Acronis Tech Support. They said that it couldn't be done.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
junglecom

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.
junglecom

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?
junglecom

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.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.