I need to do a lot of automated ftp jobs myself. I have tried several versions of this and have finally settled on a style of script that I like. I found that using a .netrc file to automate the logging-in process kept painting me into a corner because different scripts needed to sign in as different users. So I avoid .netrc and force the script to sign in. I don't like to allocate pty's unless I really am forced into it, so I also avoid pty based tools like expect. I really like ksh so that was my tool of choice. And I like the co-process concept because it makes feeding commands into the ftp process so easy with "print -p". The only problem is that the co-process manipulates standard-out so as to make it available to "read -p". And it's too hard to know how many "read -p" I will need. So I send the output to a different file descriptor. Putting it all together:
That script will tranfer the file and the output of the script will be the output from the ftp job itself. Put the script into cron and save the output so you can look at it the next morning.
Last edited by Perderabo; 07-02-2004 at 09:44 AM..
If I wanted a machine to put a specific file onto another OS far across the internet via FTP - and I wanted to do it automatically not user intervented, how would I do that?
Use the PUT command?
The file name and position never changes, it gets overwritten and the system on the other end... (6 Replies)
How can an automated script be setup to run at a later time in the day. cron runs recurring tasks. I am interested in a one time process.
I want to back up a number of files whenever I make changes to an application and ftp for backup purposes. The script to automate the zipping of files has... (1 Reply)
I have seen the script posted yesterday for automated ftp
Can we do some thing like ftp ing multiple files in one script
Example input.txt has all files names to be ftped
input.txt ------
a.tar
b.ccp
c.perl
i need to ftp all the files present in input.txt
i tried something like... (0 Replies)
Hi
I am trying to delete some specific files ( files other than created today) from the server on a cron basis. I wrote a small script, but I am stuck up in how to delete only specific files.
#!/usr/bin/expect -f
set IP
set timeout -1
spawn ftp $IP
expect ):
send "username\n"... (10 Replies)
Automated FTP.
hint : use 'atd' to schedule to run a specific script.
An Env Variable should be created,say CONF_DIR which points to some dir.
@ some time, create a TAR file of this and FTP it to some server. (3 Replies)
I want to do Automated FTP from linux client to LINUX server using a shell script after every one hour. And copies last most updated file from Linux server.
OR
You can say that whenever files get modified on LINUX server so it also copies on my LINUX client.
Linux SERVER path=... (4 Replies)
Hi all,
I'm using the following script to automated ftp files to 1 ftp servers
host=192.168.0.1
/usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp
open $host
bin
cd ${directory}
put $files
quit
ftp
and the .netrc file contain
machine 192.168.0.1
login abc... (4 Replies)
Hello,I just know the basics of scripting & I need a script to automate ftp since I use it quite often.
I use ftp to transfer different kind of files and everytime the source & the destination directories are different for transferring files, so can anyone help me out on this urgently.. (2 Replies)
Discussion started by: mohit_02mar
2 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)