I am trying to execute a python script (with chmod +x) which accepts several options via cronjob. One option is a password which I don't want to store in the crontab file, so I saved it with chmod 600 in my user's home directory (OS: raspbian). My crobtab line is:
* * * * 5 [ $(date +\%d) -le 07 ] && /opt/scripts/myscript.py -p '$(< /home/pi/mypasswordfile)' >> /tmp/backup.log 2>&1
The line
/opt/scripts/myscript.py -p '$(< /home/pi/mypasswordfile)' >> /tmp/backup.log 2>&1
is executed correctly with bash, but not from the crontab. This is correct as crontab does not execute a bash - but how to do it correctly?
Thanks in advance!