From owner-freebsd-questions@FreeBSD.ORG Wed May 19 00:16:58 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 760441065674 for ; Wed, 19 May 2010 00:16:58 +0000 (UTC) (envelope-from vinny-mail-01+f.questions20100518@palaceofretention.ca) Received: from www.giovannetti.ca (www.giovannetti.ca [206.248.136.48]) by mx1.freebsd.org (Postfix) with ESMTP id 421428FC15 for ; Wed, 19 May 2010 00:16:58 +0000 (UTC) Received: from the.palaceofretention.ca (intgateway.palaceofretention.ca [10.10.10.42]) by www.giovannetti.ca (Postfix) with ESMTPSA id A04DD2285B for ; Tue, 18 May 2010 20:11:29 -0400 (EDT) Message-ID: <4BF329CA.4050308@palaceofretention.ca> Date: Tue, 18 May 2010 19:59:06 -0400 From: Vinny User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.5) Gecko/20100103 Thunderbird/3.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <321BFC21315248CCA4341AA862E19DED@desktop2002> In-Reply-To: <321BFC21315248CCA4341AA862E19DED@desktop2002> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Wed, 19 May 2010 00:48:36 +0000 Subject: Re: I can't execute a script in crontab X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2010 00:16:58 -0000 On 05/18/2010 14:52, Yavuz Ma=C3=BElak wrote: > I use freebsd7.2 > > I wish to send a file using crontab as periodic. I have a script to sen= d > the file. > When I am root, I can execute my script, but I can't execute the script= > using crontab. > How can I run it ? > > cat myscript > /usr/bin/scp -i /root/.ssh/id_rsa.pub /root/cpfile When using scp's -i (identity) switch, you should specify the private key file, not the public key file. Perhaps this is the problem you are having.