Backup to Network Drive

Associate
Joined
15 Nov 2010
Posts
668
Hey guys,

Im looking for a good tool to backup to a network folder.
Copying maybe Documents, and putting them on the folder I chose on a network drive.

But, what is a bit of an issue at work we have to change our passwords every 3 months, this affects the built in windows backup.
And then I have to re-setup the backup using my new network password.

Is there a backup took that will use your current windows credentials?
As in if I change my password, it will automatically update and just backup like normal?

I have the network drive mapped.
 
Use Synctoy and have your network share auto connect at login? Therefore any new passwords will be prompted for and shouldn't affect the file sync/backup.
 
robotalk, it's synctoy without the GUI. seems to work quicker.


robocopy /e "%userprofile%\Documents" "\\server\networkshare\Documents"


If you copied that into notepad, then save it as 'backups.bat' (not .bat.txt) on your Desktop. Double clicking it would tell the computer to copy all files from Documents to that folder share.

The second time it runs (and every time after that) it will only copy files that have been updated or newly created.



If you're on Vista,7,8 then robocopy is already built in.

If you're using XP, then save this file and drop it in C:\Windows\System32


-edit the bat file so it has the correct paths in it, obviously
 
robotalk, it's synctoy without the GUI. seems to work quicker.


robocopy /e "%userprofile%\Documents" "\\server\networkshare\Documents"


If you copied that into notepad, then save it as 'backups.bat' (not .bat.txt) on your Desktop. Double clicking it would tell the computer to copy all files from Documents to that folder share.

The second time it runs (and every time after that) it will only copy files that have been updated or newly created.



If you're on Vista,7,8 then robocopy is already built in.

If you're using XP, then save this file and drop it in C:\Windows\System32


-edit the bat file so it has the correct paths in it, obviously

I know it's a bit of a necro, but could I amend that command to exit on error if there's no access to the destination drive or the access gets interrupted?

This looks perfect for backing up from my storage drive to MyCloud. Can it handle large file backups as in 1000's of files containing TB's of data?
 
add this in on the line above it..

if not exist \\server\networkshare goto end

Then add this in beneath the robocopy bit..

:end

If you want I'll type up a fuller one, that has pauses and changes colour etc (ie red when it's not found), then pauses for 3 seconds and quits..
 
add this in on the line above it..

if not exist \\server\networkshare goto end

Then add this in beneath the robocopy bit..

:end

If you want I'll type up a fuller one, that has pauses and changes colour etc (ie red when it's not found), then pauses for 3 seconds and quits..

I'd really appreciate that if you could type it up for me.

I've got it working quite well, and have set a task to run the backup every night at 02:00. Here's what's in the batch file just now:

Code:
robocopy /MIR "H:\_Backups" "\\WDMYCLOUD\_Backups\Garry-BackupMirror" /log+:"H:roboLog.txt" /TEE /R:0 /COPY:DT
 
Code:
@echo off
title Robocopy backup script - Start
echo.
echo Checking if backup location exists
color 8e
if not exist \\WDMYCLOUD\_Backups\Garry-BackupMirror goto error
color 89
echo.
title Robocopy backup script - Backing up
echo Backup location exist, starting backup..
ping 127.0.0.1 >nul
color 8b
echo.
robocopy /MIR "H:\_Backups" "\\WDMYCLOUD\_Backups\Garry-BackupMirror" /log+:"H:\roboLog.txt" /TEE /R:0 /COPY:DT
color 8a
echo.
echo Backup complete
title Robocopy backup script - Backup complete
ping 127.0.0.1 >nul
goto end

:error
cls
title Robocopy backup script - Backup location not found
color c0
echo.
echo %date:~6,4%-%date:~3,2%-%date:~0,2% %time:~0,2%-%time:~3,2%--%time:~6,2% backup location does not exist >>"H:\Backup failed %date:~6,4%-%date:~3,2%-%date:~0,2%.log"
echo Backup location not found, exiting backup
ping 127.0.0.1 >nul

:end

That's a good start.. I'll take another look tomorrow, kinda tired. I'll add error log file.

edit, added the echo %date bits..

It will create a file..

H:\Backup failed 2017-09-28.log

In the file, it will say..

2017-09-28 9-47--37 backup location does not exist
2017-09-28 9-47--49 backup location does not exist


(That has been run twice and failed twice)

So it's easier to understand what's going on with that code..

It's taking the %date% variable, and setting it out in YYYY-MM-DD, if you open up a cmd window, then paste this in..

echo %date:~6,4%-%date:~3,2%-%date:~0,2% %time:~0,2%-%time:~3,2%--%time:~6,2%

You'll see how it works, it will echo the date and time to the screen.
 
Last edited:
^edited.

I may make a new thread and define the source, destination and log locations as variables, so anyone can quickly pinch this to use themselves.
 
^edited.

I may make a new thread and define the source, destination and log locations as variables, so anyone can quickly pinch this to use themselves.

Yea, that'd be a good move. When added to a scheduled task, this is a really clean way of mirroring a drive for backups.
 
Back
Top Bottom