Crontab Absolute Path Auto Fill In
Hi there I have a shell command that I need to put into crontab to run
periodically.
I have test my script in the working directory, say my home directory, and
it works fine. Something similar like:
python myscript.py <input >/tmp/output
As you can see the myscript.py and input file are located in my home
directory and the output should go into the tmp folder.
I know I could use 'which' command to get the path of python and 'pwd'
command to get the working directory while I am done with my test.
However, I am wondering is there a tool or command to translate that into
the complete version easily. How could I easily replace every thing with
the full path so I could put that 'full path version' into crontab and it
could be recognized globally.
python myscript.py <input >/tmp/output
... magic ...
/usr/bin/python /home/myAccount/myscript.py </home/myAccount/input
>/tmp/output
No comments:
Post a Comment