I have written a code which moves .trc
files from source directive to backup directive. Now I have taken time (how much time older), source path and backup path as command line arguments for this file. Now when I invoke the script from sh
, it works fine. But in crontab it is not working, which left me wondering if crontab allows passing command line arguments or not. My sh
command is :
sh trace_bkp.sh 2 /home/adhikarisubir/test/basic_unix /home/adhikarisubir/test_bkp
where 2
defines 2 minutes older files, next one is soruce path and the last one is target path. I set the same in crontab as:
*/5 * * * * sh /home/adhikarisubir/test/basic_unix/trace_bkp.sh 2 /home/adhikarisubir/test/basic_unix /home/adhikarisubir/test_bkp