View Single Post
  #3  
Old 27th September 2009, 15:33
Leszek Leszek is offline
Senior Member
 
Join Date: Nov 2006
Location: Poland,Włocławek
Posts: 369
Thanks: 22
Thanked 42 Times in 35 Posts
Send a message via Skype™ to Leszek
Default

Your suggestion is good but it's working when I run Your script manually (sh /root/script.sh). When I try to make Cron do it nothing happens.
Code:
crontab -e
Code:
* * * * * sh /root/script.sh > /dev/null
I have also tried using full path:
Code:
* * * * * /bin/sh /root/script.sh > /dev/null
Here's a script from /var/scripts which Your script should execute:

Code:
#!/bin/bash
groupadd someuser
useradd -d /home/someuser -s /bin/bash -m -g someuser someuser
echo "someuser:somepassword" | chpasswd
It's also working when I run it manually.

All that might seem a little strange because I haven't fully described what I'd like to do. The test server runs Apache (default installation) with php. A php script generates shell scripts in /var/scripts/ with information provided in the form. You know the rest. I'm close but I'm missing something here because Cron doesn't execute them.
Reply With Quote