This is what my crontab looks like:
* * * * * /bin/sh /home/rathindu/assignment/test.sh
The test.sh file:
#!/bin/sh
mkdir new
The script is not running. But if I just open the terminal and invoke the script without using crontab it works perfectly.
When I inspect the CRON syslog
CRON[6909]: (CRON) info (No MTA installed, discarding output
This is what I get.
mkdir
command failed. – ajgringo619 Dec 08 '20 at 04:57/bin/mkdir /path/to/destination/new
– αғsнιη Dec 08 '20 at 05:24cd /path/to/where/your/stuff/is/there
, but it's also better to use absolute path for any commands you are using becausecrontab
has its own environment and maybe some commands it will still not able to find if you don't provide the full path – αғsнιη Dec 08 '20 at 06:05