Last active
November 9, 2015 07:47
-
-
Save momota/3dc53156d11cca031d75 to your computer and use it in GitHub Desktop.
backup pukiwiki files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
echo -n "enter sudo password: " | |
stty -echo | |
read password | |
stty echo | |
echo | |
wiki_dir=/var/www/html/wiki | |
backup_file="~/backup/`/bin/date +%Y%m%d%H%M%S`_wiki.tar.gz" | |
echo "$password" | sudo -S /bin/tar cvzf $backup_file $wiki_dir > /dev/null 2>&1 | |
echo "finish back up: $backup_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment