Jump to content

Cron jobs questions


ktsirig

Recommended Posts

Hello all!

I need to run a script periodically to get some updates, so I thought I should better place it under the cron jobs.

I have 2 questions:

 

a) This is rather silly maybe... If I schedule the script to be executed every Tuesday at 4pm for example, and the pc is turned off at that time, this means that the script will be not executed for this Tuesday and it will have to wait another week to be executed again?

 

b) It is wise to set "root" user as the user for the specific program to make sure that it has all the necessary permissions to download my updates in any folder I specify in the script? I mean, if I set a plain, restricted user as the user that runs the script, I may face problem if the script saves its downloads in /usr/local/share for example, where the plain user normally does not have write access.

 

Thank you

Link to comment
Share on other sites

A: No it will not run if the machine is off.

 

B: You have three options:

 

1. run script as root (I've never had a security issue doing that.)

 

2. Change file permissions that the script uses.

 

3. Give the script user credentials necessary to run. An example would be sudo under debian.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.