PowerShell Backup Script

Copy all your valuable Files to an external Drive, to a Network Folder or in the Cloud. Only configure your Folders you want to save, define your Destination, the Logging level and how many of your old backups you want to stay in your Destination.

4.5 Star
22,863 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
  • Not backing up all files
    1 Posts | Last post December 15, 2016
    • The script appears to run just fine, the file count is correct, and logging indicates that all files were copied.  However the backup folder has far fewer files in it that the original folder, and the number indicated by the script/log.  
  • SubDir
    2 Posts | Last post November 04, 2016
    • New to script and powershell so bear with me.
      I noticed that the script has two source dirs listed...
                  "C:\Users\Michael", ...
      I would assume that if I list a directory then it's subdirs are also copied? But then why is the AppData subdir listed above? Also, is there a way to exclude dir's like robocopy?
    • Hi,
      you are absolut correct, in this case the first directory is not necessary
  • Automatically close script
    2 Posts | Last post October 13, 2016
    • Hello Michael,
      First, this is a wonderful script.  I would like to implement this as scheduled task, though, for some computers.  With that in mind, how can I set the script to close automatically when done?
    • hi,
      just remove the last two lines.
  • Hi Dear,
    2 Posts | Last post January 04, 2016
    • First of all thanks for the Scritp, it's very usefull. I'll like to have the possibility to copy ACL's as well and Log Path Files +256 Caracters and save in Log file the Full Path for each file in order to identify the source if some error apear in any file copy.
      Thanks a lot for the help.
    • Hi, thanks for your question, will add the ACL feature to the next version.
      256 characters is a limit of Powershelgl, so not sure how to deal with it, will give it a try.
      please rate
  • Files not backed up.
    3 Posts | Last post November 23, 2015
    • Please see excerpt of log file below. All files are being skipped when running your script. I have tried this on various servers and OS versions, and the problem persists. Any ideas as to where it is going wrong?
      23.11.2015-15:16:19 - INFO: ----------------------
      23.11.2015-15:16:19 - INFO: Start the Script
      23.11.2015-15:16:19 - INFO: Check if there are more than 7 Directories in the Backupdir
      23.11.2015-15:16:19 - INFO: Create Backupdir g:\Backups\Backup-2015-11-23-4264\
      23.11.2015-15:16:19 - INFO: Move Log file to g:\Backups\Backup-2015-11-23-4264\
      23.11.2015-15:16:19 - INFO: Continue with Log File at g:\Backups\Backup-2015-11-23-4264\
      23.11.2015-15:16:19 - INFO: Check if BackupDir and Destination exists
      23.11.2015-15:16:19 - INFO: Started the Backup
      23.11.2015-15:16:19 - INFO: Count all files and create the Top Level Directories
      23.11.2015-15:16:19 - INFO: There are 48 Files with  1.41 MB of Files to copy
      23.11.2015-15:16:19 - ERROR: antenna returned an error and was not copied
      23.11.2015-15:16:19 - ERROR: images returned an error and was not copied
      23.11.2015-15:16:19 - ERROR: about.htm returned an error and was not copied
      23.11.2015-15:16:19 - ERROR: antenna.css returned an error and was not copied
      23.11.2015-15:16:19 - ERROR: contact.htm returned an error and was not copied
    • Hi, maybe you have no access to source or destination, start Script as admin.
    • I start PowerShell as Administrator, but it makes no difference. 
  • Error when running
    2 Posts | Last post September 12, 2014
    • Your script appears to work but I notice the following error that appears after every file that is copied.
      Cannot find an overload for "IndexOf" and the argument count: "2".
      At C:\software\BackupScript\BackupScript.ps1:145 char:36
      +             $Index=[array]::IndexOf <<<< ($BackupDirs,$Backup)+1
          + CategoryInfo          : NotSpecified: (:) [], MethodException
          + FullyQualifiedErrorId : MethodCountCouldNotFindBest
      Any ideas?
      Thanks Bruce
    • Hi,
      what PowerShell Version are you running?
      Run "$host.version" in PowerShell Window, maybe you are running 2.0, ther could be the Problem, please install PowerShell v3
41 - 46 of 46 Items