FTP working fine in AIX but not in Linux
Hi All
I have a script to download the file from the remote FTP server , as we recently migrated from AIX to linux server. Below is the exact same script code using in both machine Code:
HOST='ftp1.sep.com' AIX successful output PHP Code:
PHP Code:
Thanks. |
Quote:
"Expect" is typically used for such scripts, and there are plentiful examples: http://www.linuxquestions.org/questi...upload-677298/ However, I'd *STRONGLY* suggest you not use such things, but use SFTP/SCP to transfer files, by doing a key-swap between the machines. MUCH more secure... |
Thanks, I have only FTP option available to continue.
how I an proceed further. |
As suggested you need to rewrite your script. Here is a way to login similar to how you do it in AIX. The -n option prevents ftp from attempting to auto-login.
Code:
#!/bin/bash |
Thank you very much, it has worked out.
thread considered to be resolved. |
Hi,
in below script how i can write a command to delete files older then 15 days, i know mdel will use to delete files but older than 15 days deletion command please? Code:
HOST='ftp1.sep.com' |
There isn't a simple command to delete files older then x days using ftp. You can find sever similar scripts like the one below if you google. No idea how well it works.
http://stackoverflow.com/questions/1...files-from-ftp Another option would be to install curlftpfs. It is a ftp fuse filesystem. You could then write a script to use linux tools like find to delete the desired files. |
Hi ,
seems in my code '\' is ignoring in user id and considering DB_SVCGPRUAT as a ID and failing to connect to the FTP server. my complete ID 'BD\SVCGPRUAT', how to rectify this error. Code:
#!/bin/bash Connected to 10.230.120.55 (10.230.120.55). 220 Microsoft FTP Service 331 Password required for DB_SVCGPRUAT. 530 User MH_SVCGPRUAT cannot log in. Login failed. Interactive mode on. ?Invalid command 221 |
Hi ,
seems in my code '\' is ignoring in user id and considering DB_SVCGPRUAT as a ID and failing to connect to the FTP server. my complete ID 'BD\SVCGPRUAT', how to rectify this error. Code:
#!/bin/bash PHP Code:
|
???
|
To preserve a literal \ or $ in shell, have it in 'ticks'
Code:
myuser='BD\_SVCGPRUAT' |
All times are GMT -5. The time now is 03:56 AM. |