User Tools

Site Tools


troubleshooting:cronstoppedworkingonmacbook

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
troubleshooting:cronstoppedworkingonmacbook [2023/03/07 22:41] – [do we have valid crons?] kamaradskitroubleshooting:cronstoppedworkingonmacbook [2023/03/07 22:51] (current) – [final thoughts] kamaradski
Line 74: Line 74:
 </code> </code>
  
-I think this is fine, but lets see. if the above listed fix does not fix the issue i'm facingi will edit this file to 644 and try again.+This is fine, my particular issue was already fixed in the previous stephowever, if your issue is still happening you can always try edit this file to 644 and test again. 
 + 
 +===== why is cron behaving differently? ===== 
 + 
 +The cron daemon runs in the background of a system and executes scheduled tasks based on a predefined schedule. These tasks are executed in a separate environment, which is not the same as the environment of the actual user who is logged in. 
 + 
 +When a user logs into a system, they are assigned a shell, which defines their environment variables, such as PATH, HOME, and others. These environment variables are specific to the user's session and are not shared with other users or processes running on the system. 
 + 
 +In contrast, the environment in which cron jobs run is defined by the cron daemon itself. The cron daemon sets its own environment variables, which are different from those of the user who is logged in. This means that the cron jobs may not have access to the same resources or settings as the user who is logged in, such as environment variables or configuration files. 
 + 
 +Therefore, it's essential to consider the environment in which cron jobs run when scheduling tasks. It's also important to ensure that the necessary environment variables and resources are available to the cron jobs to ensure that they execute correctly. This can include setting the appropriate environment variables within the cron job itself or modifying the system's configuration to ensure that the necessary resources are available to the cron jobs. 
 + 
 +So obviously things like the below will not work: 
 +  * Any EnvVar you have set under your user environment via for example ''.bash_profile'' or ''.bashrc'' 
 +  * Use of standard variables like ''$HOME'' 
 +  * $PATH is also empty, so this is why I needed to specify the full path for the Go application in the example above
  
troubleshooting/cronstoppedworkingonmacbook.1678228864.txt.gz · Last modified: 2023/03/07 22:41 by kamaradski