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

G

Guest

Guest
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
 

christobal

Distinguished
Mar 24, 2011
1
0
18,510
I just hopped on this thread and I like what you came up with. I doubt you will ever read this, but i believe it has to do with user permissions. :bounce: