Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
sys01~> /home/test/get_gp.sh Interactive mode off. Local directory now can't find list of remote files, oops
Linux unsuccessful login outpur
PHP Code:
sys01~> /home/test/get_gp.sh Password:Name (ftp1.malaysia-airlines.com:sys01): Not logged in. Login failed. Bad sequence of commands. Interactive mode off. Local directory now /home/fisdata Not logged in. Passive mode refused. Passive mode refused. Not connected. Not connected.
issue seems it is taking script considering server level login id instead of which is defined in the FTP script, pelase advise how to rectify
Thanks.
Last edited by azheruddin; 11-28-2016 at 08:57 AM.
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
sys01~> /home/test/get_gp.sh
Interactive mode off.
Local directory now
can't find list of remote files, oops
Linux unsuccessful login outpur
PHP Code:
sys01~> /home/test/get_gp.sh
fismgr@MASG-3IFMSDB-LX:/var/run> /home/fismgr/fisbin/get_mhfy.sh
Password:Name (ftp1.malaysia-airlines.com:sys01):
Not logged in.
Login failed.
Bad sequence of commands.
Interactive mode off.
Local directory now /home/fisdata
Not logged in.
Passive mode refused.
Passive mode refused.
Not connected.
issue seems it is taking script considering server level login id instead of which is defined in the FTP script, pelase advise how to rectify
Re-write your script. Either the FTP client you're using doesn't support using "QUOTE", or there is another issue. You don't say what the remote server is running, or what your local machine is running, only that you're going from AIX to Linux, and don't tell us what's running where, or what version(s) of things you're using.
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...
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
myuser="myuser"
mypass="mypassword"
host="myhost"
ftp -nvi $host <<END_SCRIPT
user $myuser $mypass
.. rest of your commands go here
quit
END_SCRIPT
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?
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.
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.
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.
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
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.
Connected to 10.230.120.55 (10.230.120.55).
220 Microsoft FTP Service
331 Password required for BD_SVCGPRUAT.
530 User MH_SVCGPRUAT cannot log in.
Login failed.
Interactive mode on.
?Invalid command
221
To preserve a literal \ or $ in shell, have it in 'ticks'
Code:
myuser='BD\_SVCGPRUAT'
mypass='Welcome$my$friend'
# Test the variable substitution in a << here document
cat << END_SCRIPT
login $myuser
pw $mypass
END_SCRIPT
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.