Search code examples
linuxbashsolaris

How to verify scheduled run in linux


I am following this post. I want to run a python script, in the background, after logging out of ssh, witht the output stored into a specific file. Namely, I wish to use the following bash command:

nohup python3 main.py --dataset CorrSR/testTraining/small --train --input_height=256 --output_height=256 --epoch=2 | at 1:25 PM Mon > logs/background_run_small.txt &

I am not sure regarding the order of the command. is | before >? The command runs with no errors, though a process is immediately opened with

4285 pts/5 Sl 0:02 /usr/bin/python3 -u /usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/start_ipython_kernel.p

and also the output file is immediately created. Is that normal? how do I know the program waits for the designated time to run?


Solution

  • Your command line executes main.py immediately.

    What you probably want is:

    echo 'nohup python3 main.py --dataset CorrSR/testTraining/small --train --input_height=256 --output_height=256  --epoch=2 > logs/background_run_small.txt' | at "1:25 PM Mon"