The support forum

Automatic shut down

OleOz :

Apr 26, 2015

Is it possible to make the app shutdown the computer on completion of the last backup?

Alex Pankratov :

Apr 27, 2015


It certainly is - http://bvckup2.com/wip/shutdown-on-completion.png
This simply set the app to run a built-in Windows command called "shutdown" as the last step of the backup.

OleOz :

Apr 29, 2015

Thanks Alex, however I have several backups which on certain days are all supposed to run concurrently.
When I used the shutdown command on a particular backup intended to be a one off shutdown, next day I had problems because the backup completed quickly and, as it should started the shutdown. Unfortunate as I wanted to work on.
Not being an IT "techie", merely a competent user, can you point me to somewhere where I can find a glossary of available commands?
More importantly I foresee a problem with my concurrent backup days i.e. 1st backup to complete will trigger shutdown before others can complete. In Supersync Pro the auto shutdown only triggers on completion of the last backup. How can I achieve this in Bvckup?
Your words of wisdom appreciated.

Alex Pankratov :

Apr 30, 2015

Not being an IT "techie", merely a competent user, can you point me to somewhere where I can find a glossary of available commands?


It's a standard Windows command, not something that's built into the app. More precisely, it's not even a "command", but rather a program called shutdown.exe that typically sits in C:\Windows\System32. It's just that when you type "shutdown", Windows will first search for a matching program - both in current and in all system directories. It will append ".exe" and search again, so in the end it will effectively expand "shutdown" into "C:\Windows\System32\shutdown.exe" and launch that.

How can I achieve this in Bvckup?


Your only option is to write a post-backup script that would capture your intended shutdown logic. I don't know how Supersync does it, but if you have at least one periodic or real-time backup, then there's simply no such thing as a "last backup" (as there's always another backup coming up), so there's no event to attach the shutdown to.

What you can do is something like this -

1. Create a special folder to track the status of your backups. Say it's
          C:\Foo

2. For each backup - set the pre-backup command to
          echo 1 > C:\Foo\<backup-id>.active
    whereby <backup-id> is just a backup job number starting from 1

3. For each backup - set the post-backup command to
          C:\Foo\post-backup.bat <backup-id>
     whereby <backup-id> is the same as above.

     For example, for the 2nd backup on your list you should end up with
     the following pre-/post-commands:

     Pre:        echo 1 > C:\Foo\2.active
     Post:      C:\Foo\post-backup.bat 2

4. Use Notepad to create file C:\Foo\post-backup.bat as follows:

          @echo off
          del %1.active 2>nul >nul
          dir *.active  2>nul >nul
          if %errorlevel% equ 0 exit
          shutdown /s
          
That's it.

The way this works is that for each running job there'll be a corresponding x.active file in C:\Foo directory. When the job finishes, it deletes its .active file and then checks if there are any more left. If there are none, it will issue the shutdown command.

OleOz :

Apr 30, 2015

Alex, thanks your comprehensive reply.
As I got my first computer in 1978 you now have me looking for my old MS Dos and 4Dos manuals to relearn batch files etc!
Cheers

Alex Pankratov :

Oct 05, 2015

An update.

If you'd like to have a simple way to run all backups and then shutdown the computer once all of them complete, here's a little script to do that -

    https://bvckup2.com/support/data/backup-then-shutdown.bat

This requires R74.20 or newer. What it does is it kicks off all non-disabled backup jobs, then sits there waiting for the app to become idle and finally launches the "shutdown /s" command to bring the machine down.

New topic

Create
Made by Pipemetrics in Switzerland
Support


Follow
Twitter
Dev blog
Miscellanea Press resources
Testimonials
On robocopy
Company
Imprint

Legal Terms
Privacy