{"id":2432,"date":"2016-05-13T10:17:28","date_gmt":"2016-05-13T01:17:28","guid":{"rendered":"http:\/\/www.whoocus.com\/blog\/?p=2432"},"modified":"2016-05-13T10:17:28","modified_gmt":"2016-05-13T01:17:28","slug":"svn%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88-2","status":"publish","type":"post","link":"https:\/\/www.blowfish.co.jp\/?p=2432","title":{"rendered":"SVN\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b9\u30af\u30ea\u30d7\u30c8"},"content":{"rendered":"<p>[bash]<br \/>\n#!\/bin\/sh<br \/>\n#<br \/>\n# SVN Repo backup script<br \/>\n#<br \/>\nREPO_DIR=\/var\/www\/svn\/repos\/<br \/>\nMNT_DIR=\/mnt\/svn\/<br \/>\nBAK_DIR=&quot;\/\/10.0.0.0\/windows\/Backup\/dir\/svn&quot;<br \/>\nHOT_BACKUP=\/usr\/share\/doc\/subversion-1.4.2\/tools\/backup\/hot-backup.py<br \/>\nUSER_NAME=username<br \/>\nPASSWD=xxxxxx<\/p>\n<p>EXIT_STATUS=0<br \/>\n# \u4fdd\u5b58\u4e16\u4ee3\u6570(NOT WORKING)<br \/>\n# \u5b9f\u969b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306b\u8a18\u8f09\u3059\u308b\u3053\u3068<br \/>\nexport SVN_HOTBACKUP_BACKUPS_NUMBER=7<\/p>\n<p>mount -t cifs -o username=$USER_NAME,password=$PASSWD $BAK_DIR $MNT_DIR<\/p>\n<p>for REPO in `find $REPO_DIR -maxdepth 1 -mindepth 1 -type d`<br \/>\ndo<br \/>\n  $HOT_BACKUP &#8211;archive-type=gz $REPO $MNT_DIR<br \/>\n  if [ $? = 0 ]; then<br \/>\n    logger &quot;SVN Backup done. repository:$REPO, $BKFILE&quot;<br \/>\n    echo &quot;SVN Backup OK $BKFILE&quot;<br \/>\n  else<br \/>\n    logger &quot;SVN Backup NG $BKFILE&quot;<br \/>\n    echo &quot;SVN Backup NG $BKFILE&quot;<br \/>\n    EXIT_STATUS=1<br \/>\n  fi<br \/>\ndone<\/p>\n<p>umount -l $MNT_DIR<\/p>\n<p>exit $EXIT_STATUS<br \/>\n[\/bash]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[bash] #!\/bin\/sh # # SVN Repo backup script # REPO_DIR=\/var\/www\/svn\/repos\/ MNT_DIR=\/mnt\/svn\/ BAK_DIR=&quot;\/\/1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"saved_in_kubio":false,"footnotes":""},"categories":[45,4],"tags":[],"class_list":["post-2432","post","type-post","status-publish","format-standard","hentry","category-python","category-tech"],"_links":{"self":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2432"}],"version-history":[{"count":1,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2432\/revisions"}],"predecessor-version":[{"id":2433,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/2432\/revisions\/2433"}],"wp:attachment":[{"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blowfish.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}