Skip to content

Instantly share code, notes, and snippets.

@skatsuta
Last active August 29, 2015 14:04
Show Gist options
  • Save skatsuta/66020af31513718ae224 to your computer and use it in GitHub Desktop.
Save skatsuta/66020af31513718ae224 to your computer and use it in GitHub Desktop.
MySQL で dump ファイルを出力し、scp で外部サーバに転送する
#!/bin/bash
dumpfile="dump.sql"
user="user"
host="XXX.XXX.XXX.XXX"
distdir="."
mysqldump -u root dbname > $dumpfile
scp $dumpfile $user@$host:$distdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment