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.

BackupScript.zip
 
 
 
 
 
4.5 Star
(22)
20,402 times
Add to favorites
3/23/2019
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • $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.
      
      e.g.
      $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
      Mela
    • 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?
      
      Regards
      
      
      
    • 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
  • How can i use this script to upload directory to one drive?
    2 Posts | Last post January 28, 2019
    • Can we use this script for uploading directory to one drive. what changes is need to be made?
    • Hi
      easiest way, install OneDrive client and change the Target to the synced Folder
      Advanced, user the OneDrive API, maybe we will add this to the next release
      
  • Problem with $versions
    3 Posts | Last post January 28, 2019
    • I had issues with old backups not being deleted and I found that the sort order in Delete-Backupdir is the wrong and it is deleting the most recent folder (the one it is currently using).  This loses all log messages so far and leaves the old folders.  I reversed the order and changed the if statement around it to a while in case the number is ever reduced.  I also am unable to use the zip option because it hits a memory exception when the file is too large.
    • That is a great catch AlaskanShare, and one I also noticed as well.
      
      To correct this incorrect code, instead of re-writing the entire function, or statement, simply change the following:
      
      #This will remove the oldest backup first
      Select-Object -First 1 --> Select-Object -Last 1
      
    • Thanks, is fixed with release 1.4
11 - 20 of 41 Items