Title: robopower
Mission: robocopy via powershell
Author: Wolfgang Reidlinger
Version: v1.1
- Microsoft robocopy: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
Uses powershell to make the usage of robocopy even more pleasant. Define source/destination in txt files and script location in a variable and fire up. Makes backup task very simple and easy.
- define sources: in
input_sources.txt
in this formatC:\Users\Testuser\Nextcloud\WORK
(multiple sources possible, 1 source/path per line) - define destination: in
input_destination.txt
in this formatC:\Users\Testuser\Nextcloud\WORK
or\\10.0.0.10\backup\customers\evilcorp
(currently only one destionation is possible) - robocopy-logfile: unilog logfile is writte to
$script_location\log
- robopower-logfile: logfile is writte to
$script_location\log
- to run the
.ps1
file via powershell or to use it in a Microsoft scheduled task you have to change the execution policy first.
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
- unblock the file - this command removes the "blocked" status of the file, which was added because it was downloaded or copied from another machine. After unblocking the file, you should be able to run it without getting the security warning again.
Unblock-File -Path "C:\Users\user\path-to-the-file\robopower.ps1"
- define the location of the
.ps1
file in$script_location
$log_location_backup
-> define location of the logfiles at the backup destination
- check if \log directory is there, if not created!
- add function to support multiple destinations