LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 05-26-2006, 08:39 AM   #1
mcrosby
Member
 
Registered: May 2006
Posts: 39

Rep: Reputation: 15
Auto ftp shell script


hello everyone

I have been trying to get an auto ftp shell script to work and for the life of me it won't work. I have googled a million differeent thinks and found many different scripts but none of the suggestions seem to work. The problem seems to be the Kerberos V4 that is installed on the version of Red Hat that i am using. I must add that the ftp does work manually it does give me the Kerberos error but i am able to input my user/pass information. The script i have is as follows:

i currently have i have two files

ftpstartup contains :

#!/bin/sh

Today="`date +%m%d`"
mkdir $Today
cp * $Today
ftp < autoftp

auto ftp contains :

open ftp url

user
pass
cd www
cd portfolio
binary
mput *.jpg
bye

Here is what i start to get for the output :

[root@wimax-host-a Backup]# bash ftpstartup
mkdir: cannot create directory `0525': File exists
cp: omitting directory `0525'
Please login with USER and PASS.
Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Password:Name (ftp.coe.neu.edu:root):
Login incorrect.
Login failed.
?Invalid command
?Invalid command
Please login with USER and PASS.
Please login with USER and PASS.
Please login with USER and PASS.

For some reason it seems to prompt for the password but ask for the username in that password. Some websites said to alter /etc/xinetd.d/gssftp and take out a -a but that did not work for me. Does anyone know my problem?

any help would be greatly appreciated!!
 
Old 05-26-2006, 08:54 AM   #2
mcrosby
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
i solved the problem i tried a script i thought i had tried and it was successful
 
Old 05-26-2006, 09:08 AM   #3
mcrosby
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
if anyone knows how i can use auto ftp to synchronize two folders that help would be greatly appreciated. I have it so that it connects to a folder now how do I sync that with a folder on my machine.
 
Old 05-26-2006, 11:13 AM   #4
mcrosby
Member
 
Registered: May 2006
Posts: 39

Original Poster
Rep: Reputation: 15
so i can get it to automate sending and receiving between my machine and the remote server now how do I get it to sync the two?
 
Old 06-09-2006, 11:55 AM   #5
jfu62@yahoo.com
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by mcrosby
i solved the problem i tried a script i thought i had tried and it was successful
I am trying to ftp file from a Linux box to a NT Box and experiencing the very same problem. If both are Linux/Unix servers, i can use automate sftp process.
 
Old 06-09-2006, 11:58 AM   #6
jfu62@yahoo.com
LQ Newbie
 
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by mcrosby
i solved the problem i tried a script i thought i had tried and it was successful
can you share that scripts?

thank you!
 
Old 06-26-2007, 12:10 AM   #7
atantc
LQ Newbie
 
Registered: Jun 2007
Posts: 1

Rep: Reputation: 0
auto ftp script & cron

Hi, I have just read your post and it seems that you have tried some other script that it worked for you. Can I ask where you get it?!

Also, I have read up on setting a cron job as I need my ftp to be done on a regular basis. Any clues on how i can get the cron to execute the auto ftp script?

I am a newbie in linux/unix script programming. Please help. Really appreciate any form of clues.


Thanks in advance

atantc
 
Old 06-26-2007, 07:01 AM   #8
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Quote:
so i can get it to automate sending and receiving between my machine and the remote server now how do I get it to sync the two?
Why don't you use rsync for that? It will remotely synchronize the data between the server and your local machine.

--
Prasanta
 
Old 06-27-2007, 06:32 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
rsync is indeed a better option for synchronization. It may be run through a ssh tunnel for security, if I'm not mistaken. wget can also be used to download any updates from the remote machine. When run on both sides, this too may synchronize the machines, but it may be a little tricky to set up.

As for the login issue, you may add the login credentials to your .netrc file (in your $HOME).
For some ftp clients, this automatically completes the login. See "man ftp" for details.
"expect", or more advanced scripting can also be used to catch the login questions.

Alternatively, you can also use command line utilities like ncftpput (for upload) and ncftpget or wget (for download). ncftp, ncftpget, ncftpput & wget all have options to supply the user credentials.
 
Old 06-27-2007, 07:09 AM   #10
prasanta
Member
 
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368

Rep: Reputation: 37
Quote:
rsync is indeed a better option for synchronization. It may be run through a ssh tunnel for security, if I'm not mistaken. wget can also be used to download any updates from the remote machine.
I totally agree with Timmeke. You can just use your ssh keys for getting the authentication done.

--
Prasanta
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 06:32 PM
auto execute shell script on startup slackwbas Slackware 9 02-27-2005 11:26 AM
Auto-Executing Shell Script on boot benrose111488 Linux - Software 5 12-18-2004 01:52 AM
auto execute shell script ykirankumar Linux - Software 3 09-22-2004 08:23 AM
How to Shell Script auto ftp connection? mtn356 Linux - General 4 03-18-2004 08:31 PM


All times are GMT -5. The time now is 04:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration