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
21,211 times
Add to favorites
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • Issue with 7zip part
    2 Posts | Last post February 27, 2019
    • I have an issue with 7 zip part.If i comment 7zip its creating backup folder.But with 7zip it is creating the backup folder but after zip process everything will disappear .
      verified 7zip installation path and program -all good . Not sure why this is happening 
    • 27.02.2019-16:48:33 - INFO: Create Backupdir F:-----------------
      27.02.2019-16:48:33 - INFO: ----------------------
      27.02.2019-16:48:33 - INFO: Start the Script
      27.02.2019-16:48:33 - INFO: Check if there are more than 5 Directories in the Backupdir
      27.02.2019-16:48:33 - INFO: Check if there are more than 5 Zip in the Backupdir
      27.02.2019-16:48:33 - INFO: Check if BackupDir and Destination exists
      27.02.2019-16:48:34 - INFO: Started the Backup
      27.02.2019-16:48:34 - INFO: Count all files and create the Top Level Directories
      27.02.2019-16:48:34 - INFO: There are 1 Files with  0.00 MB of Files to copy
      27.02.2019-16:48:34 - INFO: ----------------------
      27.02.2019-16:48:34 - INFO: Copied 2 files with 0.00 MB of Files
      27.02.2019-16:48:34 - INFO: 0 Files could not be copied
      27.02.2019-16:48:34 - INFO: Backupduration 0 Minutes and 5 Seconds
      27.02.2019-16:48:34 - INFO: ----------------------
      27.02.2019-16:48:34 - INFO: ----------------------
      27.02.2019-16:48:34 - INFO: Compress the Backup Destination
      27.02.2019-16:48:34 - INFO: Use 7ZIP
      7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
      Scanning the drive:
      2 folders, 1 file, 1078 bytes (2 KiB)
      Creating archive: F:\-----\Backup-2019-02-27-69950.zip
      Add new data to archive: 2 folders, 1 file, 1078 bytes (2 KiB)
      Here is the log generated 
      Files read from disk: 1
      Archive size: 559 bytes (1 KiB)
      Everything is Ok
      27.02.2019-16:48:34 - INFO: Move Zip to Destination
      27.02.2019-16:48:34 - INFO: Clear Staging
      Press any key to close ...
  • Exclude a Child folder?
    3 Posts | Last post February 19, 2019
    • Love this script.
      Is it possible to Exclude a child folder that's inside the BackupDirs folder?
    • Hi,
      this is added to the next release
    • that's included in 1.4
  • $Versions="2"
    2 Posts | Last post February 19, 2019
    • $Versions="2" #How many of the last Backups you want to keep
      Also not working(
    • fixed with 1.4
  • ExcludeDirs
    3 Posts | Last post February 19, 2019
    • Hi, great Script thanks.
      I am try to copy all users Profiles and exclude for example the "Administrator" but it still copy all, include the Exclude.
      $BackupDirs="C:\Users\" #What Folders you want to backup
      $ExcludeDirs="C:\Users\Administrator" #This list of Directories will not be copied
      can you help me on this, do I doing something wrong?
      Best Regards
    • will take care in the next release
    • we have fixed this with 1.4
  • Staging Folder
    2 Posts | Last post February 19, 2019
    • we have mounted Azure file share to z:\ and try it as destination. Is it possible to create local staging folder for zip compression instead of coping all files to Network folder & then zipping to avoid double network traffic.
    • That's included in the upcoming release 1.4
  • Backup files which are used by process (similar VSS backup)
    2 Posts | Last post February 19, 2019
    • By using this script, is it possible to backup files which are in use by some process
    • this should already be possible
  • Run backup based on active user profiles in a domain enviroment
    2 Posts | Last post February 19, 2019
    • Hi, i love the script, new to this so am learning progressively and positively.
      i need this script to help me run backups for over 14 users in my domain, to backup up folders based on the active user profile logging in , and only backup files with a new modified date after a full back is set....
       Only keeps 2 version of the file backed up.
      How can i be helped on this?
    • Hi,
      that's a huge change, it is not planned n the future.
  • Zip is not working
    2 Posts | Last post February 19, 2019
    • Hello, great script! Love it! 
      Personally, I wanted to tweak it a bit with the naming of the backup to use the date rather than a random number to make it easy to locate the right backup when needed. And I changed the logging to create a .log file which is more useful in logging software. Also, I changed the log destination to their own folder, and created a script to import them to the logging software to be notified of any errors.
      Is there no way to add versioning control with this? I don't want a duplicate copy but rather have versioning like VSS or something.
      But the one thing that is not working, is Zip. This is ending without an entry to the log file and no Zip is created. The last entry on the log is "Compress the Backup Destination". After reviewing the script, I see the zip should have begun at that point and there are further entries to be made to the log if it succeeds or finds errors...neither occur. Something is causing the script to end without a log entry and I'm thinking it's my system, or others would have experienced this also.
    • That is fixed with the upcoming release 1.4
  • Can you use 7zip?
    3 Posts | Last post February 19, 2019
    • Excellent work. One limitation is the file size of the zip option being 4GB and 65K files. Is it possible to use 7zip instead/aswell? Maybe give the end user the option of which to use.
    • good point, will take care in next release
    • That is fixed with the upcoming release 1.4
  • Backup maintaining folder structure
    2 Posts | Last post February 19, 2019
    • I used your script and it worked great with the exception that all base level folder contents were copied to the root of the backup directory. Is there a way that I can maintain the full path. Example one of my backup folders is C:\claims I would like to see that folder in my backup and not just its contents in the root of the backup folder. 
    • please try our next release 1.4
11 - 20 of 43 Items