I have set up a cronjob on my server which is supposed to run every minute and store the output in the given file. I have been trying a lot and saw a lot of links but nothing seems to work. Following is the line which I wrote in crontab -e* * * * * /root/snmp_codes/snmp/.\/snmpstats.py -f file -g > logfile.logCan anyone please tell me what mistake I have made?
Crontab giving no result
linux;cron;python
Fix the path so it's correct. Based on your comment it's likely to be /root/snmp_codes/snmp/snmpstats.py.You can also modify the command so that it captures stderr as well as stdout like this (the 2>&1 attaches stderr to stdout so you get both written to the logfile.log):* * * * * /root/snmp_codes/snmp/snmpstats.py -f file -g > logfile.log 2>&1