Advertisement
c2c2_

CRON: Set variables

Dec 24th, 2024
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. Cron jobs do not import all environment variables. Luckily they do provide a way to provide variables to Cron.
  2.  
  3. Using crontab -e you can set variables just as you would in /etc/environment
  4.  
  5. Add your variables to the top of the file.
  6.  
  7. var1=/home/user/scripts
  8. var2=https://webhook.url
  9.  
  10. Save the changes.
  11. Now when you run a cron job it will have access to those variables that you set.
Tags: cron variables
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement