Jump to content
RESET Forums (homeservershow.com)

RoboCopy Backup Scripts


Recommended Posts

For your NearLine backup that looks fine. I want to mention 1 caution about using "/mir". It's the 'mirror' command. It makes the destination folder match the source folder exactly. The caution is that, if you accidentally delete a file in the source and the backup cycle takes place, the file will get deleted from the destination. On my email and client computer backup folders I do use it but, on my regular Server Folders backup I don't..... just in case ;) It's your choice of course; just wanted you to be aware of the consequences.

Link to post
Share on other sites
  • Replies 76
  • Created
  • Last Reply

Top Posters In This Topic

  • ikon

    34

  • Jason

    30

  • jmwills

    6

  • mediadogg

    2

Top Posters In This Topic

Popular Posts

Sounds like a good idea.   When I ordered my first EX-503, I wanted to get 2 of them, but their site only showed 1 available, so I ordered it and figured I'd get another when they had them in stock

Appreciate the advice. Erring on the side of caution, I'm going with your proven settings until I get some Robocopy experience under my belt. So far I've implemented Nearline. The first copy is lengthy. After will test Offsite and finally the script you use to launch them in sequence (via task scheduler). Nice that Robocopy is light on resources too!

Link to post
Share on other sites

RoboCopy is very light on resources -- no GUI after all ;)

 

You're right, the 1st copy IS lengthy, but they get a LOT shorter after that, since a huge % of most peoples' data doesn't change. What won't get shorter is the Client Computer Backups. Basically, they change every day so, as far as RC is concerned, they're new or changed files every day. It's become the longest part of the backup for me, but it's still not bad. My NearLine backup takes about 38 minutes every day.

 

I like your step-wise approach: implement 1 thing, get it all working and debugged, move on to the next. Nice job.

Link to post
Share on other sites

Ikon, may I ask what your client backup retention settings are in WHS? While tasking the Nearline script with the /Mir switch, I've noticed it's taking quite a while to backup the client computer backups folder even over USB3. If it's doing a full folder backup, there may be more data than I need.

 

Mine are... Retain daily backups for 5 days, retain weekly backups for 4 weeks, retain monthly backups for 6 months. These are defaults in WSE12R2.

Edited by Jason
Link to post
Share on other sites

I'm try to do your task scheduler method (1 script):

 

call "BackupToNearLine_RoboCopy.cmd" %1
call "BackupToOffsite (AorB)_RoboCopy - Drive-B.cmd" %1

 

Doesn't seem to launch the offsite script no matter what I do.  Fires off the NearLine and completes successfully.  Doesn't call the Offsite script.  But if I launch the offsite script manually, it runs as expected.  I've tried everything: shorter script filenames, with/without quotes, etc.  Any ideas?

 

EDIT: the only way I could resolve this was by removing the 'exit' command from the end of script #1 (nearline).  The 'backup_script.cmd' would then consistently launch nearline script, complete successfully, then fire off the offsite script and EXIT at the end of it.

Edited by Jason
Link to post
Share on other sites

Interesting. Wonder why.

 

You now have 3 CMD files, right: the short 'launcher' one, the NearLine one, and the OffSite one?

Link to post
Share on other sites

Correct. Am launching the short file via task manager. As long as I use the step in my EDIT above, it works. Whereas both of your scripts - Nearline and offsite include an EXIT command at the end.

Link to post
Share on other sites

Like I said, interesting. But hey, it works; that's the important thing. Sounds like you're pretty much done.

 

BTW. when reviewing the logs, I use Notepad. After I open a log file, I first search for "retry". Ideally, it's not found at all. Then, I search for "ended :". This takes me to the summary section for each backup command, so I can easily see if any file copies failed.

Link to post
Share on other sites
jmwills

I now this isn't PowerShell but the following is an example of a script I run to call four others to run at the sam time:

 

cd c:\scripts\metrics
.\Get-SPSiteMetrics.ps1
.\Get-SPWebMetrics.ps1
.\Get-SQLStorageMetrics.ps1
.\Get-ClosedWebParts.ps1

Link to post
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...