Skip to content

This PowerShell script quickly backs up files from selected user folders to a USB drive based on its label. It only transfers files smaller than 10MB, ensuring a fast operation. The process is optimized to allow the user to insert the USB drive, perform the backup, and eject it within seconds — ideal for quick, on-the-go "backups".

License

Notifications You must be signed in to change notification settings

ataguima/AutoUSB-Backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Backup Script for USB Drive

This PowerShell script quickly backs up files from selected user folders to a USB drive based on its label. It only transfers files smaller than 10MB, ensuring a fast operation. The process is optimized to allow the user to insert the USB drive, perform the backup, and eject it within seconds — ideal for quick, on-the-go "backups".

Features

The script performs the following actions:

  • Detects a USB drive with the specified label.
  • Creates a folder structure on the USB drive if it doesn't exist.
  • Copies files from selected folders (Downloads, Documents, etc.) to the USB drive, ignoring files larger than 10MB.

Parameters

  • DriveLabel (string): The label of the USB drive. Default is 'DRIVEUPDATE'.
  • SourceFolders (array[string]): A list of source folders to copy from. Defaults to Downloads, Documents, Pictures, Videos, and Chrome data.
  • DestinationSubfolder (string): The name of the subfolder on the USB drive where the files will be stored. Default is 'Data'.
  • MaxFileSize (long): The maximum file size to copy, in bytes. Default is 10MB.

Example Usage

.\backup-script.ps1 -DriveLabel "MY_DRIVE" -SourceFolders "$env:USERPROFILE\Documents" -DestinationSubfolder "Backup" -MaxFileSize 10485760

About

This PowerShell script quickly backs up files from selected user folders to a USB drive based on its label. It only transfers files smaller than 10MB, ensuring a fast operation. The process is optimized to allow the user to insert the USB drive, perform the backup, and eject it within seconds — ideal for quick, on-the-go "backups".

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published