Best Way To Copy New Files To Remote Server

Posted on 2011-02-28
Medium Priority
Last Modified: 2012-05-11
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
Question by:twcadmin
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
LVL 12

Assisted Solution

prashanthd earned 1600 total points
ID: 34998522
use robocopy
LVL 12

Expert Comment

ID: 34998746
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


Author Comment

ID: 34999058
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?
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

LVL 12

Expert Comment

ID: 34999490
source and destination not in domain?

Author Comment

ID: 34999615
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.
LVL 12

Accepted Solution

prashanthd earned 1600 total points
ID: 35000072
You can try the following solution

Using Robocopy across domain


Assisted Solution

Cam3ron earned 400 total points
ID: 35000180
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%

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question