nightly-restart.sh 569 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. ## this is the nightly restart script.
  3. ## it should be used by cron, just makes sure we're in the correct path
  4. ## and env vars are set before restarting
  5. ## cron example (pick different times for each server)
  6. ## ## this does a staggerd restart of the server each night
  7. ## 15 1 * * * /home/ec2-user/fc/util/nightly-restart.sh > /tmp/cron.nightly-restart.log
  8. ## save of the current path
  9. pushd .
  10. cd ~/fc
  11. ## make sure to load the env vars
  12. source ~/.bashrc
  13. ## restart the server using the normal restart script
  14. ./restart
  15. ## restore the previous path
  16. popd