Best Way To Copy New Files To Remote Server

What is the best way to copy new files to a remote server by scripting?  I have a server in the DMZ with staff pictures. I want to schedule a script at night to copy any NEW staff pictures to a folder on the DMZ server rather than wasting resources overwriting old images too.

1. Log into the remote server folder
2. Copy new files only
Who is Participating?
prashanthdConnect With a Mentor Commented:
You can try the following solution

Using Robocopy across domain
prashanthdConnect With a Mentor Commented:
use robocopy
You can use the following command,create a batch file and schedule every night

This willcopyonly file which are not in destination_dir, rest are skipped

robocopy source_dir_path destination_dir_path *.jpeg
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

twcadminAuthor Commented:
I was hoping there would be a built in command without having to install a new package but no biggie. What about providing credentials to the DMZ server since its not part of the domain?
source and destination not in domain?
twcadminAuthor Commented:
Correct. The server is in a DMZ and part of a workgroup not our internal active directory domain. When I connect to a shared folder I have to enter a different username and password.
Cam3ronConnect With a Mentor Commented:
I think the set params=/e /z line here will accomplish part of your request....doublecheck but i believe it only writes new files to the destination folder....not overwirting current files. I'll have to look and see if i have anything with a user/passwrd command that would help.

here's an example of a batch file I run nightly.

echo off
set source="C:\backup\folder\files"

set destination="\\servername\backup\folder\myfiles"

set params=/e /z
C:\robocopy.exe %source% %destination% %params%
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.