Re: I can't execute a script in crontab

2010-05-18 Thread Yavuz Maşlak
the script is already executable but it doesn't work 
-rwxrwxrwx  1 root  wheel   ..





Either make the script executable or cron it like this:

*   *  *  *  *  /bin/sh /path/to/myscript

--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: I can't execute a script in crontab

2010-05-18 Thread Rodrigo Gonzalez
The script must start with

#!/bin/sh

and be executable

On Tue, 18 May 2010 21:52:43 +0300
Yavuz Maşlak yavuz.mas...@netiletisim.net wrote:

 I use freebsd7.2
 
 I wish to send a file using crontab as periodic. I have a script to
 send 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 
 r...@192.168.10.9:/var/cpfile
 
 Thanks 
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to
 freebsd-questions-unsubscr...@freebsd.org



signature.asc
Description: PGP signature


Re: I can't execute a script in crontab

2010-05-18 Thread Paul Schmehl
--On Tuesday, May 18, 2010 21:52:43 +0300 Yavuz Maşlak 
yavuz.mas...@netiletisim.net wrote:



I use freebsd7.2

I wish to send a file using crontab as periodic. I have a script to send 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
r...@192.168.10.9:/var/cpfile



Either make the script executable or cron it like this:

*   *  *  *  *  /bin/sh /path/to/myscript

--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead. Thomas Jefferson

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: I can't execute a script in crontab

2010-05-18 Thread Jon Radel



Either make the script executable or cron it like this:

*   *  *  *  *  /bin/sh /path/to/myscript

--
Paul Schmehl, Senior Infosec Analyst

On 5/18/10 3:40 PM, Yavuz Maşlak wrote:


the script is already executable but it doesn't work -rwxrwxrwx  1 
root  wheel   ..





This list frowns on top posting, so please don't.

How do you know it doesn't work?  Seriously.  You really need to tell us 
what what you're doing, exactly, step by step, and what is happening 
when you do it, if anything.


Are you using root's crontab or something else?

Does /root/.ssh/id_rsa.pub have a passphrase on it?

--

--Jon Radel
j...@radel.com



Re: I can't execute a script in crontab

2010-05-18 Thread Vinny

On 05/18/2010 14:52, Yavuz Maþlak wrote:

I use freebsd7.2

I wish to send a file using crontab as periodic. I have a script to send
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.


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org