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
https://forums.phpfreaks.com/topic/151536-cron-jobs-questions/
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
https://forums.phpfreaks.com/topic/151536-cron-jobs-questions/#findComment-796111
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.