09-18-2008
script for download files from ftp site
I'm new to scripting. I'm trying to write a script to download files from ftp site, the following is the script and the message i get after running the script. no files were downloaded
Thanks advance!
script:
#!/usr/bin/ksh
DAY=`date --date="-1 days" +%y%m%d`
ftp -v -n "ftp.address" << cmd
user "user name" "pass word"
cd /directory
prompt
bin
mget $DAY*
quit
cmd
Message after running the script:
Connected to lnxftp.mer.com.
220 Welcome to the Mer FTP Service.
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
331 Please specify the password.
230 Login successful.
250 Directory successfully changed.
Interactive mode off.
200 Switching to Binary mode.
221 Goodbye.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am writting a shell script which will pull a list files (mentioned in one file 1.txt) from external FTP site (for ex: ftp://abcd.efghijk.com/). The 1.txt is in my local unix directory. I have username and password to connect the external FTP site.
Also before I pull the files, I need... (0 Replies)
Discussion started by: spatra
0 Replies
2. Linux
Hey everyone, my wife has purchased a bundle package of a bunch of images from a site, and now has to download each one of them manually. There are about 500 downloads, and it's quite a hassle to browse to each page and download them all individually.
I would like to write a shell script to... (2 Replies)
Discussion started by: paqman
2 Replies
3. Shell Programming and Scripting
Hi All,
I have a scenario where I need to download the previous day modified files from other server to my server through FTP . Could any one please send me the shell script for the same.
I used the following but I dont know how to proceed after this.
ftp -n -i -v $IP <<ENDOFinPUT >>... (3 Replies)
Discussion started by: sarathchandrach
3 Replies
4. Shell Programming and Scripting
HI,
I'm downloading one day old files from ftp site.
Below is my script
----------------------------
printf "open $HOST \n" > ftp.cmd
printf "user $USER $PASSWD\n" >> ftp.cmd
printf "bin\n" >> ftp.cmd
#printf "cd /Models/\n" >> ftp.cmd
printf "prompt\n" >> ftp.cmd
printf "for oldfile... (4 Replies)
Discussion started by: shekhar_v4
4 Replies
5. Shell Programming and Scripting
Trying to do the following, and it looks like Expect is probably my best bet. Any help greatly appreciated
1) Log onto ftp site
2) Go to folder
3) GET all files matching basename*.txt
4) MOVE those files to a subfolder on the ftp site. I don't need to move it on MY computer, I want to move... (2 Replies)
Discussion started by: mbourgon
2 Replies
6. Shell Programming and Scripting
Hello experts,
I have written following script to download files which created today.
Unfortunately, it's not working.
test.ksh:
#Defining variables
USR='xxx'
PASSWD='yyyy'
HT='test.test.com'
FILE='S*.pdf'
XFILE=$(echo find . -type f -mtime 0)
ZFILE=$(echo ls -tR|grep 'Jun 8')... (14 Replies)
Discussion started by: dipeshvshah
14 Replies
7. Shell Programming and Scripting
Hi there, I'm new to shell scripting and need some help if possible?
I need to create a shell script (.sh) to run as a cron job on an ubuntu linux server to connect to an external sftp sites directory using credentials (which I have) and then download to our internal ftp server and then copy... (3 Replies)
Discussion started by: ghath
3 Replies
8. Shell Programming and Scripting
Our main Server "Srv1" is used to generate text files based on specified criteria and it is also connected to two clients (pc1 and pc2) which are responsible for getting the files from Srv1 as it follows:
1. pc1 ( which represents my UNIX machine ) uses shell script to copy the files from Srv1
2.... (3 Replies)
Discussion started by: arm
3 Replies
9. Shell Programming and Scripting
Hello all,
I have been struggling with this issue on and off for a couple of weeks now and I just got it all working, so I wanted to share my findings in case some other poor soul needs to know how. First some background on what I'm doing. I am uploading files to different directories based on... (0 Replies)
Discussion started by: msjkadams
0 Replies
10. Shell Programming and Scripting
I have a job that connects to FTP site, rename, get, delete a file and then process it. The renaming is done in consideration of this is one file name into which data is being accumulated many times within 24 hour cycle.
This is what happens now:
ftp -i $FTPHOST <<-EOF
ren... (3 Replies)
Discussion started by: migurus
3 Replies
LEARN ABOUT DEBIAN
bup-ftp
bup-ftp(1) General Commands Manual bup-ftp(1)
NAME
bup-ftp - ftp-like client for navigating bup repositories
SYNOPSIS
bup ftp
DESCRIPTION
bup ftp is a command-line tool for navigating bup repositories. It has commands similar to the Unix ftp(1) command. The file hierarchy is
the same as that shown by bup-fuse(1) and bup-ls(1).
Note: if your system has the python-readline library installed, you can use the <tab> key to complete filenames while navigating your
backup data. This will save you a lot of typing.
COMMANDS
The following commands are available inside bup ftp:
ls [-s] [-a] [path]
print the contents of a directory. If no path argument is given, the current directory's contents are listed. If -a is given, also
include hidden files (files which start with a . character). If -s is given, each file is displayed with its hash from the bup ar-
chive to its left.
cd dirname
change to a different working directory
pwd print the path of the current working directory
cat filenames...
print the contents of one or more files to stdout
get filename localname
download the contents of filename and save it to disk as localname. If localname is omitted, uses filename as the local name.
mget filenames...
download the contents of the given filenames and stores them to disk under the same names. The filenames may contain Unix filename
globs (*, ?, etc.)
help print a list of available commands
quit exit the bup ftp client
EXAMPLE
$ bup ftp
bup> ls
mybackup/ yourbackup/
bup> cd mybackup/
bup> ls
2010-02-05-185507@ 2010-02-05-185508@ latest@
bup> cd latest/
bup> ls
(...etc...)
bup> get myfile
Saving 'myfile'
bup> quit
SEE ALSO
bup-fuse(1), bup-ls(1), bup-save(1), bup-restore(1)
BUP
Part of the bup(1) suite.
AUTHORS
Avery Pennarun <apenwarr@gmail.com>.
Bup unknown- bup-ftp(1)