Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Can't run ftp script in Scheduled Tasks to external IP

Can't run ftp script in Scheduled Tasks to external IP

Forum Windows XP : Windows XP General Discussion - Can't run ftp script in Scheduled Tasks to external IP

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.general (More info?)

 

I was trying to automate a backup on my Windows XP machine and ftp the
backup file to an external FTP server. I've been working on this for
several days now. Running Windows XP with SP2 and the most recent updates
applied.

"Backup.bat"
@rem Set local variables
@set currMon=%date:~4,2%
@set currDay=%date:~7,2%
@set currYr=%date:~10,4%
@set ToDir=E:\backups\
@set ScriptFile=%ToDir%Scripts\
@set FilePrefix=HT2_
@set ConfigFile=BackupConfig.bks
@set currName=%FilePrefix%%currYr%%currMon%%currDay%.bkf
@set currLog=%FilePrefix%%currYr%%currMon%%currDay%.log
@rem Execute the actual Windows backup
@echo...Now starting backup >> %ToDir%%currLog%
@ntbackup backup "@%ScriptFile%%ConfigFile%" /m normal /j "My Backup" /f
"%ToDir%%currName%" /l:f
@rem Ftp the backup to an an FTP server in LA
@echo...Now starting ftp action >> %ToDir%%currLog%
@call E:\Backups\Scripts\Ftp.bat >> %ToDir%%currLog%
@rem delete the current backup file and log
@del %ToDir%%currName% >> %ToDir%%currLog%
exit

"BackupConfig.bks"
D:\Firefox\

(Note: the above file is _NOT_ an ASCII file but was created by the System
Tool "Backup" GUI then copied to its current location)

Ftp.bat
@cd E:\Backups\Scripts
ftp -i -s:E:\Backups\Scripts\FTP.txt 2xx.xxx.xxx.xx

Ftp.txt
ftpuser
ftpuserpassword
binary
cd /ftpdirectory
mput *.bkf
quit

This all works fine when I enter "E:\Backups\Scripts\Backup.bat" in a DOS
window. But it does not work from a "Scheduled Task"! The log just keeps
growing and growing and growing and looks like:

"HT2_20050713.log"
....now starting backup
....now starting ftp action
E:\Backups\Scripts>ftp -i -s:E:\Backups\Scripts\FTP.txt 2xx.xxx.xxx.xx

E:\Backups\Scripts>ftp -i -s:E:\Backups\Scripts\FTP.txt 2xx.xxx.xxx.xx
..
..
..
..
..
Terminate batch job (Y/N)?

The ftp command just keeps going and going and going. When I copied this
same solution to a Windows 2003 server we have, and changed the IP address
to an internal 192.168.1.11 address the scheduled task worked perfectly.

What is it about an FTP to an external server IP address that prevents this
scheduled task from working?

Any help would be appreciated.

Bill_H

Sponsored Links
Register or log in to remove.
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > Can't run ftp script in Scheduled Tasks to external IP
Go to:

There are 602 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them