To reduce energy consumption you may wish to set your machine to switch on before, and off after, your scheduled backup has run. To switch it on beforehand, your department/college needs to offer Wake-on-LAN (see 2. Setting a machine to switch on for scheduled backups). However, any machine may be set to switch off after the scheduled backup has run (see 3. Setting a machine to switch off after scheduled backups), no matter where it is located. Using both these methods to switch your computer on and off automatically will mean that it will be powered on for a much shorter time. The average backup session lasts less than twenty minutes, as opposed to the fourteen hours that a computer would normally be left on for overnight.
You may be able to use Wake-on-LAN to switch your computer on automatically just before your scheduled backup starts, instead of leaving it on during the night. Wake-on-LAN is offered as part of OUCS' Energy Efficiency and Monitoring Services (EEM).
Not every college and department has signed up to offer EEM, so you need to ask your local IT staff if it is available. If so, then you can go to the EEM welcome page and sign up for Wake-on-LAN. There are two options: you can register the machine that you are currently using by selecting Register a Machine, or you can register another machine by selecting manual registration. In either case, on the registration page, you need only to select your device class (e.g. netbook, laptop or desktop) and your TSM nodename, and then you can register. Your machine will thereafter be woken at the right time for your TSM backup. Please note that on the day of your backup, you should switch off your computer when you leave it, and not put it to sleep: woken machines can sometimes revert to their sleeping state too quickly for TSM backups to begin.
Please ensure that your machine's 'Sleep mode' delay is set to at least three minutes so that it is still active when the shutdown request takes place. You can check the Power Management settings on your machine via Control Panel (Windows) or System Preferences (Mac).
- Right-click on an empty area of your desktop and select New > Text Document.
- Windows will create a new file for you, probably called
New Text Document.txt. Rename it and make sure to give the file a name ending in
myshutdown.bat, instead of
.txt. If, when you change the name, you are asked, 'If you change a file name extension, the file might become unusable. Are you sure you want to change it?', click
- Now right-click the file,
choose 'Edit', add the following line in it:
shutdown.exe -s -f -t 120 -c "Post TSM Backup Shutdown"and save the file.
- Open the folder
C:\Program Files\Tivoli\TSM\baclientand drag your
.batfile into it.
- You now need to edit the file
dsm.opt, which is also to be found in
C:\Program Files\Tivoli\TSM\baclient. In Windows Vista, 7, 2008 and 2008R2, permissions to edit the contents of
C:\Program Filesare limited. We therefore recommend that you move
dsm.optto the desktop before you open it for editing. Users of these versions of Windows should therefore drag
dsm.optto their desktop. (An alternative is to run your text editor as administrator before using it to open
Now double-click on
dsm.optto edit it. You can use Notepad or Wordpad as editor, if Windows asks which program you wish to use. Add the line:
PostNScheduleCmd '"C:\Program Files\Tivoli\TSM\baclient\myshutdown.bat"'The argument to the
PostNScheduleCmdoption is the full pathname to the
.batthat you just created. Ensure that you include both sets of quotes. (The inner quotes are required due to there being a space in the path name).
dsm.opt. If you moved it from
C:\Program Filesto your desktop in order to edit it, now move it back.
- The TSM scheduler now needs to be restarted in order for it to see the changes that you have made. If you will be restarting your computer before the next scheduled backup, then the scheduler restart will happen automatically; if not, you do need to do this manually, on which please see our page on restarting the TSM scheduler in Windows.
Now each time the TSM scheduler subsequently completes a scheduled backup it will (-s) shutdown the local machine, (-f) forcing any open applications to close, (-t 120) waiting 120 seconds before commencing shutdown (see note below) and (-c) writing a message to both screen and Event Log. Here is one source for further information on Windows shutdown syntax among many others online.
Note that a delay of 120 seconds should be sufficient for the TSM scheduler to complete its session and sign off from the backup server having received a return code from it indicating success or failure of the scheduled backup. Shortening this delay by a considerable amount is not recommended.
Try not to leave files and/or applications open overnight. The -f option will not prompt for File-Save in any open applications so will result in a loss of all unsaved data. Without this option, the shutdown may not proceed if there are any open applications or files.
- Copy the following script to a file 'myshutdown.sh' in the Tivoli Storage Manager folder
#!/bin/sh # # # myshutdown - shutdown using osascript to bypass the sudo requirement of # /sbin/shutdown # # Note: DELAY is in seconds. Do not set to less than 120. # ############################################################################## DELAY=180 /usr/bin/osascript <<END delay $DELAY tell app "System Events" shut down end END
- Now edit the file
/Library/Preferences/Tivoli Storage Manager/dsm.sysand add the line:
PostNScheduleCmd '"/Applications/Tivoli Storage Manager/myshutdown.sh"'The argument to the
PostNScheduleCmdoption is the full pathname to the file you have just created. Ensure that you include both sets of quotes. Note also that the precise text inside the quotes will vary according to the version of Tivoli Storage Manager installed on your machine and hence the name of the folder.
Now each time the TSM Scheduler subsequently completes a scheduled backup it will shutdown the local machine after a delay of 180 seconds. This delay should be sufficient for the TSM scheduler to complete its session and sign off from the backup server having received a return code from it indicating success or failure of the scheduled backup. Shortening this delay by a considerable amount is not recommended.
- Edit the file
/opt/tivoli/tsm/client/ba/bin/dsm.sysand add the line:
PostNScheduleCmd "shutdown -P +3"
Now each time the TSM Scheduler subsequently completes a scheduled backup it will shutdown the local machine after a delay of 3 minutes. This delay should be sufficient for the TSM scheduler to complete its session and sign off from the backup server having received a return code from it indicating success or failure of the scheduled backup. Shortening this delay by a considerable amount is not recommended.