From owner-freebsd-questions Sat Jan 5 19: 4:10 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mta6.srv.hcvlny.cv.net (mta6.srv.hcvlny.cv.net [167.206.5.17]) by hub.freebsd.org (Postfix) with ESMTP id 3C09237B404 for ; Sat, 5 Jan 2002 19:04:05 -0800 (PST) Received: from optonline.net (ool-4351b38a.dyn.optonline.net [67.81.179.138]) by mta6.srv.hcvlny.cv.net (iPlanet Messaging Server 5.0 Patch 2 (built Dec 14 2000)) with ESMTP id <0GPH0041CXUWVR@mta6.srv.hcvlny.cv.net> for questions@FreeBSD.ORG; Sat, 05 Jan 2002 22:04:08 -0500 (EST) Date: Sat, 05 Jan 2002 22:04:04 -0500 From: Gerard Samuel Subject: Cron//scp cron job (Re: scp job) To: freeBSD Questions Message-id: <3C37BEA4.4010801@optonline.net> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.7) Gecko/20011228 References: <20020105161404.F49802-100000@stereophonic.noops.org> <3C37AB6C.2070605@optonline.net> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ok, this one is for the archives. A how to get ssh/cron working together on FBSD. 1. Make a script ------------- #!/bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:$HOME/bin; export PATH zip -r /tmp/file /files/www/data/test scp /tmp/file.zip user@host: rm /tmp/file.zip ------------- 2. Setup ssh for entering password automatically. ------------- On the server thats sending the file run ssh-keygen, answer any neccessary questions. Copy /.ssh/identity.pub to the recieving server. Move identity.pub on the receiving box to .ssh/authorized_keys. -------------- 3. Now you should be able to run the script in step 1 and it executes properly. Setup cron to execute the script, and youre done... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message