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.p

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

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 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/sc

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 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

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 t

I can't execute a script in crontab

2010-05-18 Thread Yavuz Maşlak
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

Re: Can't execute a script

2005-09-09 Thread Gary W. Swearingen
"N.J. Thomas" <[EMAIL PROTECTED]> writes: > Normally, that doesn't matter because most Unix utilities are > multi-eol-format aware, but you can't have it in the shebang line > because the OS interprets the extra carriage as part of the command, so > it is looking for /bin/sh^M, which doesn't exist

Re: Can't execute a script

2005-09-09 Thread bob self
I wasn't aware of the eol issue and don't know how the 0x0d got there, but I fixed it with 'dosunix' and it works now. Thanks, Bob ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe

Re: Can't execute a script

2005-09-09 Thread N.J. Thomas
* bob self <[EMAIL PROTECTED]> [2005-09-09 18:41:35 -0400]: > 000: 2321 2f62 696e 2f73 680d 0a65 6368 6f20 #!/bin/sh..echo ^^ > 010: 2270 696e 6769 6e67 2e2e 2e2e 220d 0a"pinging".. Yup, that's your problem. This file is a DOS text file, so its

Re: Can't execute a script

2005-09-09 Thread Gary W. Swearingen
bob self <[EMAIL PROTECTED]> writes: > xxd scripttest: > > 000: 2321 2f62 696e 2f73 680d 0a65 6368 6f20 #!/bin/sh..echo ^^-- BAD NEWS It doesn't work on 5.4, either, or probably any Unixy OS. BTW, the base OS comes with "hd" for a similar display. __

Re: Can't execute a script

2005-09-09 Thread bob self
N.J. Thomas wrote: I've seen something like this happen when there is a non-printing character on the shebang line (like a CTRL-G or similar). So instead of running /bin/sh, your shell tries to run "/bin/sh^G" -- which obviously doesn't exist. Can you run "xxd /root/bin/scripttest" and show us

Re: Can't execute a script

2005-09-09 Thread N.J. Thomas
* bob self <[EMAIL PROTECTED]> [2005-09-09 15:01:25 -0400]: > #!/bin/sh > echo "pinging" > #end of scripttest > > If I run "which scripttest", I get /root/bin/scripttest > > But if I try to run this test script I get "scripttest: Command not found." > > Why is that happening? I've seen some

Re: Can't execute a script

2005-09-09 Thread bob self
Peter A. Giessel wrote: On 9/9/2005 11:01, bob self seems to have typed: If I run "which scripttest", I get /root/bin/scripttest But if I try to run this test script I get "scripttest: Command not found." Its a stupid thought, but could you run "which sh"? ___

Re: Can't execute a script

2005-09-09 Thread bob self
Peter A. Giessel wrote: On 9/9/2005 11:01, bob self seems to have typed: If I run "which scripttest", I get /root/bin/scripttest But if I try to run this test script I get "scripttest: Command not found." Its a stupid thought, but could you run "which sh"? [EMAIL PROTECTED]/bin

Re: Can't execute a script

2005-09-09 Thread Glenn Dawson
At 12:49 PM 9/9/2005, bob self wrote: Glenn Dawson wrote: Assuming you're using csh, did you rehash after creating the script? Did you try to execute it with it's full path? like: /root/bin/scripttest -Glenn Yes, I did 'rehash'. I'm running tcsh as root, FreeBSD 6.0. Also, I ran "/root/bin/s

Re: Can't execute a script

2005-09-09 Thread Peter A. Giessel
On 9/9/2005 11:01, bob self seems to have typed: > If I run "which scripttest", I get /root/bin/scripttest > > But if I try to run this test script I get "scripttest: Command not found." Its a stupid thought, but could you run "which sh"? ___ freebsd-qu

Re: Can't execute a script

2005-09-09 Thread bob self
Glenn Dawson wrote: Assuming you're using csh, did you rehash after creating the script? Did you try to execute it with it's full path? like: /root/bin/scripttest -Glenn Yes, I did 'rehash'. I'm running tcsh as root, FreeBSD 6.0. Also, I ran "/root/bin/scripttest" and I still get "command no

Re: Can't execute a script

2005-09-09 Thread Glenn Dawson
At 12:01 PM 9/9/2005, bob self wrote: I have a simple test script called 'scripttest' in /root/bin: -rwxr-xr-x 1 root wheel 121 Sep 9 14:55 scripttest my $PATH IS /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:*/root/bin* #!/bin/sh echo "pinging...

Can't execute a script

2005-09-09 Thread bob self
I have a simple test script called 'scripttest' in /root/bin: -rwxr-xr-x 1 root wheel 121 Sep 9 14:55 scripttest my $PATH IS /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:*/root/bin* #!/bin/sh echo "pinging" #end of scripttest If I run "wh