Skip to content

Commit

Permalink
Fix for YunoHost 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maniackcrudelis committed Jan 20, 2021
1 parent 29e0dbd commit 3a74d37
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions commons/functions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

ynh_backup="sudo yunohost backup create"
ynh_compress_backup="tar --create --acls --preserve-permissions --xattrs --absolute-names --gzip"
ynh_restore="sudo yunohost backup restore --force"
ynh_backup_delete="sudo yunohost backup delete"

Expand Down
8 changes: 4 additions & 4 deletions deploy_process/close_fallback.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ backup_command="$ynh_backup $backup_ignore --system $backup_hooks --name $backup
main_message ">>> Make a backup for $backup_name"
# Make a backup
$backup_command
# Copy the backup in the dedicated directory
sudo cp "/home/yunohost.backup/archives/$backup_name.tar.gz" "$local_archive_dir/$backup_name.tar.gz"
# Compress the backup
ynh_compress_backup --file "$local_archive_dir/$backup_name.tar.gz" /home/yunohost.backup/archives/$backup_name.{tar,info.json}
# Then remove the backup in yunohost directory.
sudo yunohost backup delete "$backup_name"
# Encrypt the backup
Expand All @@ -116,8 +116,8 @@ do
main_message ">>> Make a backup for $backup_name"
# Make a backup
$backup_command $appid
# Move the backup in the dedicated directory
sudo cp "/home/yunohost.backup/archives/$backup_name.tar.gz" "$local_archive_dir/$backup_name.tar.gz"
# Compress the backup
ynh_compress_backup --file "$local_archive_dir/$backup_name.tar.gz" /home/yunohost.backup/archives/$backup_name.{tar,info.json}
# Then remove the backup in yunohost directory.
sudo yunohost backup delete "$backup_name"
# Encrypt the backup
Expand Down
10 changes: 5 additions & 5 deletions send_process/send_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ backup_checksum () {
# Make a temporary backup
main_message_log "> Make a temporary backup for $backup_name"
rm -rf "$temp_backup_dir" 2>&1 | $logger
if ! $backup_cmd --no-compress > /dev/null
if ! $backup_cmd --methods copy > /dev/null
then
# If the backup fail, do not make a real backup
echo ">>> The temporary backup failed..."
Expand Down Expand Up @@ -102,8 +102,8 @@ then
main_message_log ">>> Make a real backup for $backup_name"
# Make a real backup
$backup_command 2>&1 | $logger
# Move the backup in the dedicated directory
mv "$temp_backup_dir/$backup_name.tar.gz" "$main_archive_dir/$backup_name.tar.gz" 2>&1 | $logger
# Compress the backup
ynh_compress_backup --file "$main_archive_dir/$backup_name.tar.gz" "$temp_backup_dir/$backup_name".{tar,info.json} 2>&1 | $logger
# Then remove the link in yunohost directory.
rm -f "/home/yunohost.backup/archives/$backup_name".{tar.gz,info.json} 2>&1 | $logger
# Encrypt the backup
Expand Down Expand Up @@ -133,8 +133,8 @@ do
main_message_log ">>> Make a real backup for $backup_name"
# Make a real backup
$backup_command $appid 2>&1 | $logger
# Move the backup in the dedicated directory
mv "$temp_backup_dir/$backup_name.tar.gz" "$main_archive_dir/$backup_name.tar.gz" 2>&1 | $logger
# Compress the backup
ynh_compress_backup --file "$main_archive_dir/$backup_name.tar.gz" "$temp_backup_dir/$backup_name".{tar,info.json} 2>&1 | $logger
# Then remove the link in yunohost directory.
rm -f "/home/yunohost.backup/archives/$backup_name".{tar.gz,info.json} 2>&1 | $logger
# Encrypt the backup
Expand Down

0 comments on commit 3a74d37

Please sign in to comment.