From owner-freebsd-questions Wed Aug 16 7: 3:52 2000 Delivered-To: freebsd-questions@freebsd.org Received: from mail2.wmptl.com (mail2.wmptl.com [216.221.73.131]) by hub.freebsd.org (Postfix) with ESMTP id 3A5F337C024 for ; Wed, 16 Aug 2000 07:03:46 -0700 (PDT) (envelope-from webmaster@wmptl.com) Received: from wmptl.com ([10.0.0.168]) by mail2.wmptl.com (8.9.3/8.9.3) with ESMTP id KAA46619; Wed, 16 Aug 2000 10:01:11 -0400 (EDT) (envelope-from webmaster@wmptl.com) Message-ID: <399A9EA4.6009120F@wmptl.com> Date: Wed, 16 Aug 2000 10:01:08 -0400 From: Nathan Vidican X-Mailer: Mozilla 4.72 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 To: Rezamys Cc: questions@freebsd.org Subject: Re: FTP Using Cron in Freebsd 4.0 References: <00d101c5a21a$4aa05c80$0b1603c8@tmmaster> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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