Computing.Net > Forums > Disk Operating System > copy files from 1 server to another

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

copy files from 1 server to another

Reply to Message Icon

Name: danny d
Date: July 6, 2003 at 11:14:47 Pacific
OS: winnt server 4
CPU/Ram: dual p3 800
Comment:

I'm trying to copy files from one server to another using a batch file..
the batch file runs every morning at 7:00 ..
I use winat to automat this batch file to run evey morning..

this is what I got

Copy \\appnt4\backups\current\data d:\prgra~1\service\data /q

but it never runs thru winat.... If I manualy run the batch file from a dos window it works..any ideas??? why its not working???



Sponsored Link
Ads by Google

Response Number 1
Name: bitbyte
Date: July 7, 2003 at 03:59:01 Pacific
Reply:


winat wrong configured that the batch never starts
or
wrong rights when running the batch from winat


0

Response Number 2
Name: danny d
Date: July 7, 2003 at 05:54:57 Pacific
Reply:

the batch starts up. fine..but when it gets to the copying portion of the batch file it doesn't do anything...... it by passes it and goes on to the rest of the batch file...
I have also tried using net use...nothing works.. here is a sample of the batch file


@echo off

:: Set the debugging code.
set zTrace=no
set zDisplay=^>NUL^: 2^>^&1
set zPause=
if /I "%zTrace%" EQU "yes" (@echo on & set zDisplay= & set zPause=@pause)


set zMJTempLog=C:\Scripts\MJTempAT.log
set zMJLog=C:\Scripts\MaintenanceJobReports.log
set zPgmLoc=D:\Progra~1
set zLFScanLog=%zPgmLoc%\Servic~2\Logs\lfscan.log
set zReboot=no

call c:\scripts\GetDateTime.cmd
echo %DT_YEAR%/%DT_MONTH%/%DT_DOM% (%DT_DOW%) @ %DT_HOUR%:%DT_MIN%:%DT_SEC% - ServiceCenterReports Maintenance Job - Started > %zMJTempLog%


------------------
::
:: Stop the Services.
::

set zAppDir=%zPgmLoc%\Servic~2

net stop "ServiceCenterReports" /yes %zDisplay%
if "%errorlevel%" EQU "0" (echo The "ServiceCenterReports" NT Service was successfully stopped.) >> %zMJTempLog%
if "%errorlevel%" NEQ "0" (echo The "ServiceCenterReports" NT Service could not be stopped. The return code was: "%errorlevel%".
echo Processing is continuing.) >> %zMJTempLog%

net stop "SCAutomate Pager" /yes %zDisplay%
if "%errorlevel%" EQU "0" (echo The "SCAutomate Pager" NT Service was successfully stopped.) >> %zMJTempLog%
if "%errorlevel%" NEQ "0" (echo The "SCAutomate Pager" NT Service could not be stopped. The return code was: "%errorlevel%".
echo Processing is continuing.) >> %zMJTempLog%


set zAppDir=%zPgmLoc%\Servic~1

net stop "ServiceCenter" /yes %zDisplay%
if "%errorlevel%" EQU "0" (echo The "ServiceCenter" NT Service was successfully stopped.) >> %zMJTempLog%
if "%errorlevel%" NEQ "0" (echo The "ServiceCenter" NT Service could not be stopped. The return code was: "%errorlevel%".
echo Processing is continuing.) >> %zMJTempLog%


set zAppDir=%zPgmLoc%\Servic~3

net stop "ServiceCenterAT" /yes %zDisplay%
if "%errorlevel%" EQU "0" (echo The "ServiceCenterAT" NT Service was successfully stopped.) >> %zMJTempLog%
if "%errorlevel%" NEQ "0" (echo The "ServiceCenterAT" NT Service could not be stopped. The return code was: "%errorlevel%".
echo Processing is continuing.) >> %zMJTempLog%


------------------
::
:: Copy production backup files into ServiceCenterReports (Development Server) and replace
:: existing data
::

del %zPgmLoc%\Servic~2\data\*.* /q


xcopy \\appnt4stha13\backups\current\data\*.* %zPgmLoc%\Servic~2\data\ /q

------------------
::
:: Start the Services.
::

if /I "%zReboot%" EQU "yes" (goto :End)

net start "ServiceCenter" %zDisplay%
if "%errorlevel%" NEQ "0" (goto :error1)
echo The "ServiceCenterReports" NT Service was successfully started. >> %zMJTempLog%

net start "SCAutomate Pager" %zDisplay%
if "%errorlevel%" NEQ "0" (goto :error2)
echo The "SCAutomate Pager" NT Service was successfully started. >> %zMJTempLog%

net start "ServiceCenterAT" %zDisplay%
if "%errorlevel%" NEQ "0" (goto :error1)
echo The "ServiceCenterReports" NT Service was successfully started. >> %zMJTempLog%

net start "ServiceCenterReports" %zDisplay%
if "%errorlevel%" NEQ "0" (goto :error1)
echo The "ServiceCenterReports" NT Service was successfully started. >> %zMJTempLog%

goto :End


------------------
::
:: The error processing.
::

:error1

echo Error: The "ServiceCenter" NT Service could not be started. >> %zMJTempLog%

echo Error: The "ServiceCenterAT" NT Service could not be started. >> %zMJTempLog%

echo Error: The "ServiceCenterReports" NT Service could not be started. >> %zMJTempLog%


goto :End


------------------
::
:: Termination.
::

:End

call c:\scripts\GetDateTime.cmd
echo %DT_YEAR%/%DT_MONTH%/%DT_DOM% (%DT_DOW%) @ %DT_HOUR%:%DT_MIN%:%DT_SEC% - ServiceCenterReports Maintenance Job - Ended >> %zMJTempLog%
echo. >> %zMJTempLog%

:: Add the current log info to the top of the running log file.
copy %zMJTempLog%+%zMJLog% %zMJTempLog%
type %zMJTempLog% > %zMJLog%
del %zMJTempLog% /q

%zPause%

:: DO NOT ADD ANY CODE AFTER THE :EOF LABEL!
:EOF


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: copy files from 1 server to another

copy files from NT server www.computing.net/answers/dos/copy-files-from-nt-server/13174.html

Copying files www.computing.net/answers/dos/copying-files-/11698.html

Copy file from server to desktop www.computing.net/answers/dos/copy-file-from-server-to-desktop/10314.html