Skip to main content

How can I do a bi-weekly backup?

Thread needs solution

I would like to schedule a single backup scheme to run on the first and third Tuesday of each month. I can easily do one or more dates a month, or every Tuesday, or one Tuesday, but I can't seem to figure out how to do two Tuesdays. Any thoughts?

0 Users found this helpful

Bruno, the scheduler within the ATIH GUI doesn't offer you a way of doing what you ask, i.e. run only on the first and third Tuesday of each month, therefore you would need to take a different approach to achieve this.

One possible method would be to setup a weekly task that runs on every Tuesday but then use a Pre-Command with this that checks what week it is and only runs on the 1st and 3rd weeks.

This can be done using Powershell with (Get-WmiObject Win32_LocalTime).weekinmonth which will return the week number (i.e. 1,2,3,4 or 5) that you could test for in a PS script.

I can't claim any experience in writing Powershell scripts but you can do a search in Google and find some good examples of writing simple scripts.

See How to determine which week it is in the month in PowerShell? where the above PS code came from.

Thanks, Steve. Before I saw your response I started down that route and wrote a simple batch file that basically does the same thing. I used a very similar approach.

 

Hi Bruno, one downside to using week numbers is simply those weeks where the 1st & 3rd Tuesdays actually fall in weeks 2 & 4...!

There is an easier way of doing this that I remembered after sleeping on things last night...

Use the Windows Task Scheduler which does allow you to trigger the backup task on the 1st & 3rd Tuesdays of each month, where you just need to have it either call a simple batch program or call the Acronis task launcher directly using the task script identifier.

Example: I created a simple batch file with the contents:

"C:\Program Files (x86)\Acronis\TrueImageHome\TrueImageLauncher.exe" /script:A0D4DF8F-3A10-4320-B1D6-B278397FC785

where the /script: part was the identifier for the task I wanted to schedule.

In Windows Task Scheduler, create a basic task, give it a name, select to run this monthly, then choose the 1st & 3rd Tuesdays and select all months, finally, either browse to the path of the batch file, or manually enter the program path and put the /script part in the optional arguments field.  Note: you can paste the whole of the above program string directly into the program entry box and you will see a pop-up offering to put the argument into the separate box for you.  See screen shots below.

Attachment Size
411109-138490.png 15.22 KB
411109-138493.png 8.6 KB

Hi Steve. Thanks for another way of doing this. I realized very quickly that the weekinmonth method would not give the desired result. But I had already come up with a simple batch file that can be used as a Pre-command. Rather than explain it, I'll just attach the batch file (well commented) for the forumites (forumonians?). I think it's easier than going through the  task scheduler and doesn't involve script IDs.

I have not yet tested it in production, but I think it ought to work. If anyone spots a problem, please let me know.

(I had to add a .txt extension to attach it here)

Attachment Size
411128-138508.txt 1.88 KB

Bruno, thanks for sharing your batch file method, have saved a copy for future reference.  Please let us know how it works when you test it in production.

As I await the first test today, I did a little thought experiment and realize a potential, but not disastrous issue.

I have two backup tasks, both scheduled for Tuesdays at 5:00. I want one to run on the first and third Tuesday while the other will run on the second and fourth Tuesday. I've just read that Acronis cannot do two backup tasks simultaneously, so the the first one must complete before the second one starts. But only one should be allowed to run anyway. I'll be interested to see the logs after 5:00 today.

It ran the first test today.

On the up side, the backup I wanted to run did run and the one I did no want to run did not run.

On the downside, the pre -command error caused that backup to re-attempt every five minutes until I got that turned off. But also, it flashed a command windows on the screen for a second when the pre-command batch file ran, and because of the failure it marked the whole backup as a failure... big red X. That's unfortunate as I the backup did not fail... it just never ran.

I think I may combine my batch file with Steve's task scheduler approach into something better so that Acronis will only be invoked when I want it to. The downside of that is that Acronis would have the backups "unscheduled"; all the information about the schedule would be hidden.

Bruno, thanks for the further update - I have to confess to having had mixed results with using Pre Commands as Acronis tends to read that a successful execution of the command equates to a successful result, when in reality it may mean that the test being performed failed and a negative result was returned.

Using the Windows Task Scheduler combined with a batch file is a more reliable way of achieving the desired results for this specific topic, plus it is a whole lot easier to update the batch file content to modify the /script: identifier if needed for a different or new task.  The task would show in the ATIH GUI as being unscheduled but the last backup date/time would be shown correctly, just not when the next scheduled backup is due (as this is being handled outside of the application).

I would suggest submitting Feedback to Acronis on this requirement to have a more comprehensive scheduler function within the ATIH application instead of making users jump through hoops to achieve such a simple requirement as running twice a month on a Tuesday!

Does it always have to be Tuesday? If not, you could switch to a monthly scheme and pick specific dates to run on every other week, like the 1st and 15th. Unfortunately, it would be whatever day that actually falls on, but if that's not important, works well.

Here's an update after the second test. I made no changes since last time other than unchecking the error handling option to retry. The results were different in that the backup that was not supposed to run today did not run, but it was also NOT marked as an error. So both backups look good from the main UI... both show successful with the correct last backup times as well as both showing next Tuesday as the next backup time.

This is just what I wanted to see.

Sounds good Bruno!