Révision 8550e097
Ajouté par Julien Enselme il y a plus de 9 ans
bin/d7-sync-site.sh | ||
---|---|---|
27 | 27 |
|
28 | 28 |
|
29 | 29 |
# Backup the database of SOURCE_SITE |
30 |
current_date="$(date "+%Y-%m-%d-%Hh%Mm%Ss")"
|
|
30 |
current_date=$(date "+%Y-%m-%d-%Hh%Mm%Ss")
|
|
31 | 31 |
if [ "$1" = "default" ] ; then |
32 | 32 |
dir="$2" |
33 | 33 |
else |
... | ... | |
45 | 45 |
# Sync databases |
46 | 46 |
## Save file system |
47 | 47 |
if [ -z "${new_site}" ] ; then |
48 |
private_path="$(drush "@$2" vget --format=string file_private_path 2> /dev/null)"
|
|
49 |
public_path="$(drush "@$2" vget --format=string file_public_path 2> /dev/null)"
|
|
50 |
temp_path="$(drush "@$2" vget --format=string file_temporary_path 2> /dev/null)"
|
|
48 |
private_path=$(drush "@$2" vget --format=string file_private_path 2> /dev/null)
|
|
49 |
public_path=$(drush "@$2" vget --format=string file_public_path 2> /dev/null)
|
|
50 |
temp_path=$(drush "@$2" vget --format=string file_temporary_path 2> /dev/null)
|
|
51 | 51 |
fi |
52 | 52 |
|
53 | 53 |
## Sync |
54 |
current_date="$(date "+%Y-%m-%d-%Hh%Mm%Ss")"
|
|
54 |
current_date=$(date "+%Y-%m-%d-%Hh%Mm%Ss")
|
|
55 | 55 |
sql_file="${dir_tmp}/${current_date}.$1.sql" |
56 | 56 |
drush -y "@$1" sql-dump --result-file="${sql_file}" |
57 | 57 |
sed -i -e "s#https?://assos.centrale-marseille.fr/$1#https://assos.centrale-marseille.fr/$2#g" "${sql_file}" |
Formats disponibles : Unified diff
Command subsitution are not quoted. Quotes posed problems in loop.