Skip to content

Instantly share code, notes, and snippets.

@zgabievi
Created February 9, 2016 14:31
Show Gist options
  • Save zgabievi/7bb7476d463045e6349f to your computer and use it in GitHub Desktop.
Save zgabievi/7bb7476d463045e6349f to your computer and use it in GitHub Desktop.
#!/bin/bash
LOG=/path/to/logs/COMMAND.log
while true; do
nohup /path/to/php /path/to/artisan COMMAND >> ${LOG} &
PID=$!
echo [`date +%Y-%m-%d:%H:%M:%S`] ${PID} STARTED >> ${LOG}
wait ${PID}
echo [`date +%Y-%m-%d:%H:%M:%S`] ${PID} ENDED >> ${LOG}
done;
@zgabievi
Copy link
Author

zgabievi commented Feb 9, 2016

Change PATHs and COMMANDs on your purpose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment