Python Script Not Work With Incron
incrontab -e /home/owen/file_to_be IN_ALL_EVENTS /home/owen/abc.py owen@desktop:~$ cat abc.py #!/usr/bin/env python # -*- coding: utf-8 -*- p = open('file_to_test', 'a+') p.writ
Solution 1:
Perhaps the script is working,but not as you expected... Put the full path to the file generated by the script, i.e.:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
p = open('/tmp/file_to_test', 'a+')
p.write("test")
p.close()
Then check than the file '/tmp/file_to_test' is generated, the problem can be the environment that uses incron to run the script.
Post a Comment for "Python Script Not Work With Incron"