Jump to content

PowerShell Script to Backup Files - Revisions Welcome


Oracle

Recommended Posts

Oracle

I wrote this today, and seems to do the trick. I've been playing a lot with PowerShell recently and am looking for any feedback, or additional tricks/tools I can use to refine this script.

Ideally, it would be nice to have a 1-1 sync between source and destination, but robocopy won't allow that. But, for the time being, this'll do!

You all are welcome to it, as well!

server_backup_test.ps1

  • Thanks 1
Link to comment
Share on other sites

justinrh

Simple and clean.  Why did you choose RoboCopy instead of Copy-Item?

I'd suggest some status output like "now copying Movies".

Why are you clearing the screen between copies?  Sometimes it is nice to keep the output in case there is an error or other unexpected msg.

To be more PowerShelly, replace pause with Read-Host "put prompt here".

Now you need to put in some error management - the fun part!  Logging?

Link to comment
Share on other sites

Oracle
11 hours ago, justinrh said:

Simple and clean.  Why did you choose RoboCopy instead of Copy-Item?

I'd suggest some status output like "now copying Movies".

Why are you clearing the screen between copies?  Sometimes it is nice to keep the output in case there is an error or other unexpected msg.

To be more PowerShelly, replace pause with Read-Host "put prompt here".

Now you need to put in some error management - the fun part!  Logging?

Ha, I chose RoboCopy instead of Copy-Item, because I am rather unfamiliar with the function of Copy-Item and had a pre-existing script written using Robocopy that I used previously. What would syntax look like for Copy-Item?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...