There are two files. The first is the python code (say_hello.py):
def write_text(text): with open('text.txt', 'a') as the_file: the_file.write(text + '\n') if __name__ == '__main__': write_text('bla-bla') The second is the shell script that runs this file (hello.sh):
#!/bin/bash python3 /home/ubuntu/say_hello.py And there is a cron that runs the sh file every minute ($ sudo crontab -e):
* * * * * /home/ubuntu/hello.sh Why does nothing work?)