15 7 * * * /usr/bin/screen -dmS ANameForTheScreenSession commandIwantToRunInScreen
where:
- /usr/bin/screen is the location of the screen command; make sure you already have screen installed by running `which screen` which should return the location, or install it by using `apt-get install screen`.
- ANameForTheScreenSession is a name to identify the session
- commandIwantToRunInScreen is the command you used to start the mining proxy
If all goes well, after the cron job starts again, you should be able to view the proxy by running `screen -r ANameForTheScreenSession`. Once in the screen session, you can disconnect from the session by pressing Ctrl-A + D; the proxy will continue to run in the background.
References:
http://www.linuxquestions.org/questions/linux-software-2/running-screen-in-a-cron-job-349153/
http://ss64.com/bash/screen.html
EDIT: If your proxy cron job is running as root, then the screen session will also run as root. If this is the case, simply prepend "sudo" to the command used to view the session.