YunoHost-Apps / restic_ynh

Restic package for YunoHost
https://restic.net/
GNU Affero General Public License v3.0
6 stars 10 forks source link

First run after install doesn't work #24

Open e-jim opened 4 months ago

e-jim commented 4 months ago

Describe the bug

First run of the app doesn't work (subsequent run don't work either)

Context

Steps to reproduce

Expected behavior

My storage box would fill itself with a fresh backup

Logs

I noticed two lines in particular (from journalctl -u restic): tee: /var/log/restic_backup_restic.err: est un dossier ``/var/www/restic/restic: ligne 1: BZh91AY : commande introuvable```

Findings

Running file /var/www/restic/restic showed my that this file was not an executable binary but a bz2 archive. So I moved it, and unarchived it:

mv /var/www/restic/restic /var/www/restic/restic.bz2
cd /var/www/restic  
bzip2 -dk  restic.bz2 

Running systemct start restic worked after that, so it seems the installation process install the compressed file instead of the uncompressed binary of restic

Also, it seems it set /var/log/restic_backup_restic.err as a folder where it should be a file.

e-jim commented 4 months ago

I think (but I don't know much about it) that the line in manifest.toml

rename "restic"

should become:

rename "restic.bz2"

and then the lines in /scripts/install

ynh_setup_source --source_id=main --dest_dir="$install_dir"
chmod +x "$install_dir/restic"

should be:

ynh_setup_source --source_id=main --dest_dir="$install_dir"
bunzip2 -d -f /var/www/restic/restic.bz2
chmod +x "$install_dir/restic"