mirror of
https://github.com/sbrl/bin.git
synced 2018-01-10 21:33:46 +00:00
Update backup script
This commit is contained in:
parent
886ca06332
commit
7aa35636ce
1 changed files with 8 additions and 2 deletions
10
backup
10
backup
|
@ -3,12 +3,18 @@
|
||||||
if [[ -z "$1" ]]
|
if [[ -z "$1" ]]
|
||||||
then
|
then
|
||||||
echo Error: Not settings file specified!
|
echo Error: Not settings file specified!
|
||||||
|
echo Settings files are located in ~/.config/backups.
|
||||||
|
echo To use one, simply specify it\'s name. e.g. \'backup riftgate\' would use the \'~/.config/riftgate.config\' backup configuration file.
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
. "$1"
|
CONFIG_FILE=~/.config/backups/$1.config
|
||||||
|
|
||||||
echo "Backing up to ${BACKUP_DIRECTORY}."
|
echo Using config file ${CONFIG_FILE}.
|
||||||
|
|
||||||
|
. "${CONFIG_FILE}"
|
||||||
|
|
||||||
|
echo "Backing '${SOURCE_DIRECTORY}' up to '${BACKUP_DIRECTORY}'."
|
||||||
|
|
||||||
if [[ ! -w "${BACKUP_DIRECTORY}" ]]
|
if [[ ! -w "${BACKUP_DIRECTORY}" ]]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in a new issue