|
|
@ -3,12 +3,12 @@
|
|
|
|
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
|
|
|
# causes the shell to exit if any subcommand or pipeline returns a non-zero status
|
|
|
|
set -e
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
|
|
app=ynhexample
|
|
|
|
# The last argument is the app instance name
|
|
|
|
|
|
|
|
app=${!#}
|
|
|
|
|
|
|
|
|
|
|
|
# The parameter $1 is the backup directory location
|
|
|
|
# The first argument is the backup directory location for the app
|
|
|
|
# which will be compressed afterward
|
|
|
|
# from where the script is executed and which will be compressed afterward
|
|
|
|
backup_dir=$1/apps/$app
|
|
|
|
backup_dir=$1
|
|
|
|
sudo mkdir -p $backup_dir
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Backup sources & data
|
|
|
|
# Backup sources & data
|
|
|
|
sudo cp -a /var/www/$app/. $backup_dir/sources
|
|
|
|
sudo cp -a /var/www/$app/. $backup_dir/sources
|
|
|
|