Web Hosting Talk







View Full Version : cron questions


Haze
04-10-2002, 10:08 PM
I need to create a cron job to do the following:
cp -R /home/username/tmp/webalizer/ /home/username/public_html/webstats/
chown username:username /home/username/public_html/webstats
chmod 655 /home/username/public_html/webstats

What would be the best way of doing this? Do I really need to create a new cron job for each command? Will I need to somehow create a perl script to do the above?

glypto.com
04-10-2002, 10:23 PM
This should work!


#!/bin/bash
cp -R /home/username/tmp/webalizer/ /home/username/public_html/webstats/
chown username:username /home/username/public_html/webstats
chmod 655 /home/username/public_html/webstats

Haze
04-10-2002, 10:33 PM
Interesting.. do I need to chmod that file at all? If so, to what? Also, can I add the same commands but for other users to it?

glypto.com
04-10-2002, 10:43 PM
1. Yes, you do!

2. 755 !

3. I believe so :)

Haze
04-10-2002, 11:42 PM
Thanks for that.. works perfect.