El Gallo Negro
El Gallo Negro

Reputation: 1

Commands Not Executing When Using At Command

I have a very simple bash script written,

    #!/bin/bash
    echo "python /home/user1/Downloads/program.py" | at 10:00 

but it doesn't execute. All of the jobs seem unexecuted because when I run atq (at queue) I see all the attempts I have made.

I am on Linux Mint if that helps at all.

Upvotes: 0

Views: 256

Answers (1)

LeadingEdger
LeadingEdger

Reputation: 714

Here is how you can go about troubleshooting to find the root cause of your problem. Create a simple python script at /home/user1/Downloads/date.py

date.py contains the following entries.

#!/usr/bin/python3
import datetime
print ("From date.py: It is now", datetime.datetime.now() )

Then schedule the script to run and write any output to /home/user1/date.log For example,

echo "/home/user1/Downloads/date.py >> /home/user1/date.log 2>&1" | at 12:15

Check /home/user1/date.log and you should see an entry like this after the job runs:

From date.py: It is now 2020-07-05 12:15:00.637742

Upvotes: 0

Related Questions