popeye
November 6, 2013, 9:51am
1
My cron file. Copied $PATH
# Minute Hour Day of Month Month Day of Week Command
SHELL=/bin/ksh
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/perl/lib:/perl/lib/lib/perl5:/perl/scripts:.:/perl/lib/local:/home/popeye:/temp
0 12 * * * /home/popeye/xferResult &
The script
#!/usr/bin/expect
spawn ftp -i 2.22.221.211
expect ":"
send "popeye\n"
expect ":"
sleep 1
send "thesailorman\n"
expect ">"
send "cd filestore\r"
expect ">"
send "put /home/popeye/Resulta\r"
#send "mput /home/popeye/Result*\r"
expect ">"
sleep 2
send "bye\r"
close
The error
spawn ftp -i 2.22.221.211
Connected to 2.22.221.211 (2.22.221.211).
220 ProFTPD 1.3.4a Server FTP Server [::ffff:2.22.221.211]
Name (2.22.221.211:): popeye
331 Password required for popeye
Password:
230 User popeye logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd filestore
250 CWD command successful
ftp> mput /home/popeye/Result*
local: /home/popeye/Resulta remote: /home/popeye/Resulta
227 Entering Passive Mode (2,22,221,211,66,33).
550 /home/popeye/Resulta: No such file or directory
local: /home/popeye/Resultb remote: /home/popeye/Resultb
227 Entering Passive Mode (2,22,221,211,66,34).
550 /home/popeye/Resultb: No such file or directory
local: /home/popeye/Resultc remote: /home/popeye/Resultc
227 Entering Passive Mode (2,22,221,211,66,35).
550 /home/popeye/Resultc: No such file or directory
local: /home/popeye/Resultd remote: /home/popeye/Resultd
227 Entering Passive Mode (2,22,221,211,66,36).
550 /home/popeye/Resultd: No such file or directory
ftp>
The files are there. Any help would be very appreciated.
Thanks Regards
POP
---------- Post updated 11-06-13 at 09:51 AM ---------- Previous update was 11-05-13 at 01:53 PM ----------
I solved the problem. I was wondering how to close threads. I like to keep a tidy ship.
vbe
November 6, 2013, 9:55am
2
If you solved the problem, it would be nice NOT to ask to close the thread but to explain what was the issue and the remedy applied...
popeye
November 11, 2013, 7:16am
3
To solve the problem
Use
expect ">"
send "lcd /home/popeye\r"
expect ">"
send "mput /home/popeye/Result*\r"
expect ">"