Skip to content

Instantly share code, notes, and snippets.

@furu
Created October 16, 2014 09:37
Show Gist options
  • Save furu/4b1e6eb3206741590c7e to your computer and use it in GitHub Desktop.
Save furu/4b1e6eb3206741590c7e to your computer and use it in GitHub Desktop.
#!/bin/sh
service tomcat7 stop
mkdir -p /var/backups/gitbucket
cd /var/lib
tar cfz /var/backups/gitbucket/gitbucket-`date +%Y%m%d`.tar.gz gitbucket
service tomcat7 start
cd /var/backups/gitbucket
find -type f -name "gitbucket-*.tar.gz" -mtime +2 -delete
# rsync やら nfs やらで他のサーバに転送するなり何なりする
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment