Pelco Consulting has written a very basic backup script that utilises the Windows Powershell interface.
For those that are not familiar with Windows Powershell, it is a command line based scripting tool that allows system administrators to write scripts. In a nut shell, Windows Poershell is the modern day version of the old '.bat' files from DOS.
The beauty of this backup utility is that system administrators can use this script to setup various backups of various directories which can then be set to run as a scheduled task via the Windows Task Scheduler.
One particular use in this respect is the automated backup of Outlook '.pst' files. By using the Windows Task Scheduler, you can ensure the shut down of Outlook via a scheduled task 5 minutes prior to the running of the backup of the '.pst' file.
The script for the automated backup contains a series of options and settings for the backup.
This script must be saved as a '.ps1' script and then set to start via Powershell. You must have enabled the processing of local scripts on your machine by setting the execution policy for Powershell scripts.
You can do you by opening a powershell window and changing your execution policy to 'RemoteSigned' as this will allow for the processing of unsigned scripts that your write on your machine. If you require other signing options, you can find more information on the 'Running Scripts From Within Windows Powershell' on the Microsoft Technet Library.
Once your system can run powershell scripts that you write, you can open the Windows Powershell ISE. This will create a blank '.ps1' file that you can use to create your desired script.
The script requires a few variables. Firstly you must set the source folder. This is the folder you want to copy the files from. The next variable is the backup folder. This is the location you want to backup your files to. This may be a network drive or external hard drive. If it is a network drive you can manage advanced settings via the task scheduler to only run when a specific network connection is available. Alternatively, you could ensure the connection is open by writing a script to run before this that opens the network location. The third and final variable is the location of the log file for this backup script. This is required as the script will create a text record of the file it copied and the last time that the script ran.
For testing purposes, we recommend you create a series of demo folders and run a practice with a few, small files.
The log file will show a listing of files and indicate at the bottom of the file what time the backup last ran. If you do not want to use a log file simply comment out both line 25 and line 31.
A few important items to note are that the first search of files makes use of '-recurse' [Line 19]. This will search that directory and all directories and files inside that directory. If you only want to backup new files in a single directory, you can remove the '-recurse'.
Download Script