Linux: Run cron job in foreground

前端 未结 4 574
眼角桃花
眼角桃花 2020-12-30 09:59

In Linux, is there a way to run a cron job in the foreground (or interactive mode)? (I have a program that runs periodically to accept user input and do some processing. So

4条回答
  •  余生分开走
    2020-12-30 10:43

    Try this out on your user's crontab:

    @hourly DISPLAY=:0 xterm -e /path/to/my/script.sh
    

    It will open (hourly) an xterm with your script executing, and exit after your script exits. Of course, you should modify the @hourly part to suit your needs.

提交回复
热议问题