(Grav GitSync) Automatic Commit from tanshu

This commit is contained in:
tanshu 2017-11-23 06:00:15 +00:00 committed by GitSync
parent c8b71264e7
commit 1f606e838c

View File

@ -31,3 +31,19 @@ nohup env RACK_ENV=production bundle exec rackup -p $PORT config.ru > /dev/null
sleep 3
pgrep -f "ruby2.4 /home/tanshu/gems/bin/rackup -p $PORT config.ru" > /home/tanshu/webapps/warden/run/ruby.pid
```
3.2 `Stop` script where `$PORT` is the port of the custom webapp
```sh
#!/bin/sh
/usr/bin/pkill -f "ruby2.4 /home/tanshu/gems/bin/rackup -p $PORT config.ru" && rm -f /home/tanshu/webapps/warden/run/ruby.pid
```
3.3 `Restart` script
``sh
#!/bin/bash
$HOME/webapps/warden/bin/stop
sleep 3
$HOME/webapps/warden/bin/start
```
3.4 Edit crontab using `export VISUAL=nano; crontab -e` and add the following line
```sh
*/20 * * * * ~/webapps/warden/bin/start
```