Please, can someone explains me How I can use scripts that recall system variables inside a crontab?
I have something like as crontab file input
#################################################
** # /home/giampiero/TO_BE_CROND/list.cron
Test di utilizzo di crontab
HOME=/home/giampiero
SHELL=/bin/bash
/home/giampiero/TO_BE_CROND/script > /home/giampiero/TO_BE_CROND/out 2>&1**
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
then I update it using:
**
/usr/bin/crontab /home/giampiero/TO_BE_CROND/list.cron**
the script is like
#!/bin/bash
date >> $GHOME/date_test
the output is
**
/home/giampiero/TO_BE_CROND/script: line 4: /date_test: Permission denied**
The script driven by crontab doesn’t recognize the system variable GHOME, I tried also inserting export and set without success
It may be worth mentioning that what you were after were environment,
not system variables (‘system’ implies they are system-wide, which is
not the case necessarily). Also, cron never keeps your environment
variables, and typically that’s not an issue since you can set them
within the crontab as you did, though most people set them explicitly
per their needs I think.
Good luck.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/