• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Setting up a cron job...

flippinfleck

Golden Member
I'd like to be able to automaticaly update offline content from online content with wget without any user interaction.

I know all the commands for wget, but am not sure on how to set this up using cron. I would like this job to be run as a specific user (not root), saving the (if any) updated content to a specific folder outside of this users home directory.

Anyone know how to do what I'm looking for?
 
Well, when do you want it to update, and how often?

Sme examples:

Every hour on the 37's (11:37, 12:37, 13:37, etc):

37 * * * * wget (options)

Every day at 5:30 PM:

30 17 * * * wget (options)

Every 2 hours:

* */2 * * * wget (options)


The format for crontab entries is MIN HOUR DAY MONTH DAYOFWEEK COMMAND according to the manpage. Of course, your distro may have a simpler way of doing things in addition to editing the crontab directly. For example, Slackware has a /etc/crontab heirarchy, in which you can put shell scripts which will be run automaticly using a pre-configured crontab. Dunno if other distros have this, since I don't use any other distros.
 
Silly me. I was looking for weekly updates.

I'm using RH 7.2.xxx, and it DOES have the /etc/cron.daily etc directories. But these are all owned by root. It's not possible for some other user to put anything in there, is it? I know I can chown and whatnot, but I'd rather not.

Could I make an update_web.sh script with all the neccesary wget commands using root and then chown it to another user? Or would that still not work...

Or should I just run crontab -u (user) -e ?? Would it be simpler to set it up that way?
 
Back
Top