Noob Cronjob question

Anyways I ran the group command to see which groups the root is a member of. apparently it is only the member of root. so I tried running usermod -a -G cron root but I was returned with an error:

usermond: group 'cron' does not exist

One would think that a root user would have access to everything :cry:
 
You made a simple mistake, nothing to do with having root as a member of group cron (actually group cron does not even exists)
The following will sort out the permission denied

30 12 * * 1,2,3,4,5 /bin/bash /root/enable.sh >/dev/null 2>&1

or you could do change your script to
#!/bin/bash
/sbin/service dansguardian-av stop
/usr/bin/yes | /bin/cp -rf /etc/dansguardian-av/lists/onbannedsitelist /etc/dansguardian-av/lists/bannedsitelist
/sbin/service dansguardian-av start

then
chmod u+x /root/enable.sh

then the cron entry should work
30 12 * * 1,2,3,4,5 /root/enable.sh >/dev/null 2>&1
 
Just a handy tip, use "tail -f" to "follow" the log file and basically get a live output of what's being logged there.
 
Always specify the shell used at the top of script
Code:
#!/bin/bash

If you want to debug this script, then you can run it as:
Code:
bash -x script.sh
or, change the script to
Code:
#!/bin/bash -x

This will give you the problem immediately when scheduled.
 
Just a question. It looks like you are blocking sites during "working" hours and letting people access the blocked sites during tea, lunch and after hours. Are you using squid with dansguardian? Can't you just setup a time based ACL?
 
Top
Sign up to the MyBroadband newsletter
X