Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Aug 2000 10:01:08 -0400
From:      Nathan Vidican <webmaster@wmptl.com>
To:        Rezamys <rezath@tm.net.my>
Cc:        questions@freebsd.org
Subject:   Re: FTP Using Cron in  Freebsd 4.0
Message-ID:  <399A9EA4.6009120F@wmptl.com>
References:  <00d101c5a21a$4aa05c80$0b1603c8@tmmaster>

next in thread | previous in thread | raw e-mail | index | archive | help
> Rezamys wrote:
> 
> Hello All,
> 
> I would like to know is there any possibility that by using Cron one
> can automatically ftp to another server?
> 
> My idea is:
> a)  Set time; say after every 30 minutes run cron job
> b)  Ftp to another database server (in this case the server runs on
> solaris 2.6). Directory is /pub
> c)  Extract new data from that d/base server & put it in my Freebie
> server; say directory /pub/something
> d) Mark a time "tag" on each new data
> 
> If it can be done so, how?
> Is there any configuration script sample that I can refer or any site
> that you can point to?
> 
> 
> All advise is much appreciated.
> TQ
> 
> 

I have a similar script, it does the opposite though; it uploads a file.
I have the script tar our entire database structure, then upload it via
ftp to a windows box which intern places the file into a directory on a
Novell fileserver with the date/time as it's filename, example:
20000816-database.tgz.
	The script is written in PERL, and it uses a system() call to
'ncftpput'. Ncftpput/ncftpget will allow you to put/get files to/from an
ftpserver via the command line, (which could also be a system call from
a script or  other program). ncftp is in the ports collection, (that's
where I got it from anyhow). Mine runs from cron on a nightly basis, so
the time portion was of no concern to me, but it should be just as easy
as placing the date into the filename.
	If you want, I could email you a copy of the script I wrote? You could
easily modify it to do what you want. Of course, you could probably do
this with a simple shell script, but I know PERL, and I don't know shell
scripting very well; so I used PERL.

-- 
Nathan Vidican
webmaster@wmptl.com
Windsor Match Plate & Tool Ltd.
http://www.wmptl.com/


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?399A9EA4.6009120F>