How to automatically run a backup and then shutdown your computer at night

Discussion in 'Acronis True Image Product Line' started by geklingel, Jun 11, 2009.

Thread Status:
Not open for further replies.
  1. geklingel

    geklingel Registered Member

    Joined:
    Oct 11, 2004
    Posts:
    14
    How to automatically run a backup and then shutdown your computer at night.
    First:
    Open the Windows Task Scheduler from the control panel and create a scheduled task to run Acronis True Image daily at a specific time.
    Second:
    Open the Search option from the START menu and search your system hard disk (usually drive C) for the Windows file shutdown.exe
    There may be multiple shutdown programs; the one you want is in the WINDOWS System Folder. Copy down the file path to the shutdown program. In my case it is C:\WINDOWS\system32
    Third:
    Create or Edit your backup task as follows:
    Schedule it to run one minute later than the task you added to the Task Scheduler.
    When you get to the “Backup Options” page in the backup wizard open the “Pre/Post Commands” page, select the “Use Custom Commands” button which will allow you to edit the “Before and After” backup processes. Select the “Edit” button for the “After” backup process and enter the following:
    On the “Command” line enter the file path and program to be executed.
    In my case C:\WINDOWS\system32\shutdown.exe
    On the “Working Directory line enter the file path only.
    In my case C:\WINDOWS\system32
    On the “Arguments” line enter a slash followed by a lower case S ( /s )
    Check the boxes for “Do not perform operations until the command’s execution is complete” and “Abort the operation if the user command fails”. Click OK
     
  2. oracledba

    oracledba Registered Member

    Joined:
    Jul 17, 2006
    Posts:
    30
    Good idea. Here is a similar idea if anyone cares to have it.
    Below are two dos batch files.
    The first performs the backup, and when completed calls the 2nd.
    The 2nd performs a shutdown with a 5 min countdown thus giving the user a way to abort the shutdown and continue working if desired.
    To perform a backup manually just double click the 1st file ( or icon pointing ot it). If you want your a backup automatic/un-attended put the 1st file on the windows scheduler. When I define a backup job in acronis I usually have it email a success/failure to me so next time I check email I have proof backups are working.


    Code:
    :: -- my_incr_shutdown.bat
    :: --  (version1)
    :: -- Run an acronis job. manually (create icon and double click it)
    :: -- I call the shutdown here and NOT as a post task of the acronis job.
    :: -- The main reason why is schd. backups need to leave pc up so diskeeper and windows update
    :: -- will be able to run. THis manual backup is for when I want a backup and a shutdown.
    :: -- FYI: finding the .tis file is not straight forward the way I have been doing it is to
    :: -- create/edit the job then go to that folder and do a directory listing by date.
    :: --
    :: -- do the backup
    "C:\Program Files\Common Files\Acronis\TrueImageHome\TrueImageHomeService.exe" /script:"C:\Documents and Settings\All Users\Application Data\Acronis\TrueImageHome\Scripts\7F72F487-FC67-4B5C-83A8-BCF75BD6AC26.tib.tis"
    :: --
    :: --
    :: -- do the shutdown
    C:\mybackup\post_backup_shutdown.bat
    :: -- DONE
    


    Code:
    :: --  post_backup_shutdown.bat
    :: --
    :: -- The concept is Acronis will do a backup and when the backup is complete it will shutdown the pc.
    :: -- Since acronis does not have this option built-in but DOES have the ability to call a batch script
    :: -- at the end of the backup - this script can perform the shutdown.
    :: --
    :: -- To be "nice" to the user of the PC we will give a 5 minute countdown to a shutdown.
    :: -- The intent is this script will be run at night when everyone is asleep.
    :: --
    :: -- The bizzare number of spaces below are a feeble attempt to format a message within the dialog box.
    :: -- If I knew how to format an carriage return I would have done so.
    :: --  -t ## is countdown to shutdown
    :: --  -s means shutdown the pc (-r would mean restart)
    :: --  -c "xxx" is a comment text to user
    :: --  -f forces running applications to close without warning.
    :: --
    shutdown  -t 300 -f -s -c "Acronis Backup done                                                SHUTDOWN in x seconds                      TO CANCEL the shutdown                        click start run and type                             \"shutdown -a\"               (no quotes)"
    :: --
    :: -- DONE
    
     
  3. geklingel

    geklingel Registered Member

    Joined:
    Oct 11, 2004
    Posts:
    14
    Yes, I previously tried executing the backup directly from the task scheduler (without shutdown) and it worked OK except that when I opened Acronis task manager it did not show the last task execution information even though it had created a log. Plus using the post process option means you don’t have to figure out which script to run if you have multiple backup tasks
     
Thread Status:
Not open for further replies.