Backup forum

A place to discuss Backup software and online services

You are not signed in.

Announcement

Signed in and can't post? Click here!Hot Tags: account Android Archive cleanup Code42 CrashPlan Backup bug bugs cleanup CcrPU Delete desktop error fail failed failure feature request idevsutil iDrive community incremental internet issue linux log login mac Mobile password performance progress QNAP REST restore Security slow speed suggestions support sync Synology upgrade upload windows backblaze carbonite SugarSync Dropbox Veeam Memopal Netgear Asustor Pro Softnet Corporation Raghu Kulkarni
  • Index
  •  » Common Room
  •  » Run a script before and after completion of IDrive backup RSS Feed

#1 2020-06-08 22:49:52

bribri
New member
Registered: 2020-05-06
Posts: 3

Run a script before and after completion of IDrive backup

Is it possible to run a script (BAT/CMD file) before or after the IDrive backup runs?

I've got my backups scheduled for 2am, so I could of course run something at 1:55am. But is there a way to automatically run a script after backup completes, rather than having to guess at when it might be done?

Offline

 

#2 2020-06-09 01:27:02

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Run a script before and after completion of IDrive backup

bribri wrote:

I've got my backups scheduled for 2am, so I could of course run something at 1:55am. But is there a way to automatically run a script after backup completes, rather than having to guess at when it might be done?

No need to guess when its done wink

When IDrive is running a backup, it uses a process called idwutil_600.exe, so the script you run at 01:55 could stay running and monitor that process until it disappears.

tasklist | findstr "idwutil_600.exe"

will return errorlevel of zero if the task is not running, so you could loop until that happens (with some sort of pause*, to avoid too many resources being used), then continue the rest of the script and perform the after-backup tasks.

* depending on your version of Windows, you should have the timeout command, which will pause for the number of seconds you specify as a parameter.

Offline

 

#3 2020-06-09 13:03:34

SteveA
Administrator
Registered: 2018-02-23
Posts: 406
Website

Re: Run a script before and after completion of IDrive backup

This seems to work, adjust it for your needs:

Code:

@echo off
Setlocal EnableDelayedExpansion

rem Pre-tasks...
rem
rem
echo Waiting for backup to start

:WaitForStart
timeout 10
tasklist | findstr "idwutil_600.exe"
if NOT "!errorlevel!" == "0" goto WaitForStart
echo Backup started

timeout 600
rem 10 minute wait here to allow "Prepare file list" to complete.

:WaitForFinish
timeout 10
tasklist | findstr "idwutil_600.exe"
if "!errorlevel!" == "0" goto WaitForFinish
echo Backup finished

rem Post-tasks...
rem
rem

endlocal

The reason for the 10 minute wait is because idwutil_600.exe starts when the Prepare file list begins, but seems to quit again a few seconds later, then doesn't run until the backup actually starts.

You may need to play with this value.

Offline

 
  • Index
  •  » Common Room
  •  » Run a script before and after completion of IDrive backup RSS Feed

Board footer

Protect your brand, users & email deliverability. Let’s Encrypt- free, automated, and open certificate authority (CA) StatusCake Monitoring Service Stop Forum Spam

Powered by © Copyright 2002–2005 Rickard Andersson
SteveA's forums are free for everyone to use, however if you would like to contribute to the upkeep I would be grateful for any donation!