# \[Restic\] Backup with restic

**URL:** https://forum.yunohost.org/t/restic-backup-with-restic/10340
**Category:** Apps
**Tags:** restic
**Created:** [February 23, 2020, 8:17pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340 "2020-02-23T20:17:04Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 23, 2020, 8:17pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/1 "2020-02-23T20:17:04Z")

</div>

Salut, suite à la procédure que j’ai postée pour [la sauvegarde avec Restic](https://forum.yunohost.org/t/sauvegarde-yunohost-avec-restic/10275), j’ai créé un [package restic](https://github.com/ashemsay/restic_ynh), ça serait cool si des gens pouvaient le tester et s’il pouvait être ajouté au catalogue en mode `in progress` 🙂

* * *

[english version]  
Hello, following [the backup procedure with restic](https://forum.yunohost.org/t/sauvegarde-yunohost-avec-restic/10275) I posted earlier this week, I create a [package](https://github.com/ashemsay/restic_ynh).  
It would be awesome if people were able to test it and if it could be added to the apps catalog with the `in progress` state 🙂

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [February 24, 2020, 12:46pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/2 "2020-02-24T12:46:37Z")

</div>

I have made the PR on apps list for you, i have also forked into YunoHost-Apps organisation and give you right on the repo.

> <https://github.com/YunoHost/apps/pull/874/files>

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 24, 2020, 5:06pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/3 "2020-02-24T17:06:32Z")

</div>

Thank you!

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 27, 2020, 7:04pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/4 "2020-02-27T19:04:59Z")

</div>

Ok so now my app passes the tests on the dev ci.  
What’s next? I guess I wait for your pull request to be merged?

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [February 27, 2020, 7:23pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/5 "2020-02-27T19:23:40Z")

</div>

If you think it could be declared “working” instead of inprogress i can change that on the PR

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 27, 2020, 8:53pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/6 "2020-02-27T20:53:35Z")

</div>

Yes, that would be nice, thanks.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [February 28, 2020, 11:37am UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/7 "2020-02-28T11:37:05Z")

</div>

Your app has been included and tested on official ci : [https://ci-apps.yunohost.org/ci/job/6254](https://ci-apps.yunohost.org/ci/job/6254)

Congratulations

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 28, 2020, 5:29pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/8 "2020-02-28T17:29:20Z")

</div>

That’s really cool.  
I just read the contributor doc and saw that it was clearly explained how to get here.  
Thank you for doing the job for me.

Now what I did not get is how to make the app appear on the APPS CI Dashboard.  
Any hint on that?

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [February 28, 2020, 5:35pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/9 "2020-02-28T17:35:40Z")

</div>

Your app is already listed on [https://ci-apps.yunohost.org/ci/](https://ci-apps.yunohost.org/ci/) but not on [dash.yunohost.org](http://dash.yunohost.org) (maybe we need to do something to update data on it)

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [February 28, 2020, 5:40pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/10 "2020-02-28T17:40:05Z")

</div>

Yes that’s what I meant, [https://ci-apps.yunohost.org/ci/](https://ci-apps.yunohost.org/ci/) is refered to as `Apps Continuous Integration` and [https://dash.yunohost.org/appci/branch/stable](https://dash.yunohost.org/appci/branch/stable) is referred to as `Apps CI Dashboard` in the contributor documentation.

Apparently that’s what’s missing for the app integration level badge link to work on the github repository

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [February 28, 2020, 6:17pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/11 "2020-02-28T18:17:20Z")

</div>

I think it’s a question of time to get the result from CI Apps to be include in the apps list…

---

<div class="post-metadata">

### Author: ![valterbarreira](https://forum.yunohost.org/user_avatar/forum.yunohost.org/valterbarreira/32/2838_2.png) [@valterbarreira](https://forum.yunohost.org/u/valterbarreira)
#### Post date: [March 24, 2022, 9:36am UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/12 "2022-03-24T09:36:54Z")

</div>

Does restic’s backups always full or incremental?  
I configured and made the first backup and it lasted for almost 24 hours.

Also noticed that restic created the backup folders on /tmp, but i defined the backup folder on /mnt/backups that is mounted on a S3 bucket

Is safe to delete these tmp folders and how prevent restic to create these folders again?

Also, how to do the restore with restic?

---

<div class="post-metadata">

### Author: ![tomdereub](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@tomdereub](https://forum.yunohost.org/u/tomdereub)
#### Post date: [March 24, 2022, 1:57pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/13 "2022-03-24T13:57:41Z")

</div>

Restic backups incremental. My first backup lasted a few days, but now the everynight backup lasts about an hour or so.

---

<div class="post-metadata">

### Author: ![valterbarreira](https://forum.yunohost.org/user_avatar/forum.yunohost.org/valterbarreira/32/2838_2.png) [@valterbarreira](https://forum.yunohost.org/u/valterbarreira)
#### Post date: [March 30, 2022, 9:43am UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/14 "2022-03-30T09:43:35Z")

</div>

Yes, restic is backing up daily and its incremental and fast.  
So restic is using /tmp and is using a lot of space, i remember that on the setup it was declared a temp folder that restic could use, can i change this location and delete the files on /tmp?

---

<div class="post-metadata">

### Author: ![valterbarreira](https://forum.yunohost.org/user_avatar/forum.yunohost.org/valterbarreira/32/2838_2.png) [@valterbarreira](https://forum.yunohost.org/u/valterbarreira)
#### Post date: [April 7, 2022, 10:12am UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/15 "2022-04-07T10:12:57Z")

</div>

@bleeh Hi, could you help me with my question?

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [April 11, 2022, 7:04pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/16 "2022-04-11T19:04:46Z")

</div>

Hey, I did not plan for it to be modified, an to be totally honest I never managed to make this temp space thing work as I wanted.

I have several restic releases to catch up with so I created [an issue](https://github.com/ashemsay/restic_ynh/issues/20) and I’ll take it into account for the next version of the package since it’s not complicated at all but I can’t tell you when that will be.

---

<div class="post-metadata">

### Author: ![valterbarreira](https://forum.yunohost.org/user_avatar/forum.yunohost.org/valterbarreira/32/2838_2.png) [@valterbarreira](https://forum.yunohost.org/u/valterbarreira)
#### Post date: [April 12, 2022, 1:51pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/17 "2022-04-12T13:51:09Z")

</div>

So, even if i uninstall and install and configure again, i can’t change the tmp dir?

---

<div class="post-metadata">

### Author: ![ghose](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ghose/32/10939_2.png) [@ghose](https://forum.yunohost.org/u/ghose)
#### Post date: [September 28, 2022, 1:20pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/18 "2022-09-28T13:20:22Z")

</div>

I’ve restic making daily backups.

I’ve tried to restore one app (for testing purposes) and the info.json is not accepted from YNH backup system.

**Please would anyone share how they restore backups?** and/or any tip.

I take backup folder for the given app; make a .tar file; move it to /home/yunohost.backup/archives folder and then try to restore it (tried from command line and webinterface with the same result: json not valid)

I’ve copied app.json.info outside .tar file following what I see for other backups present in /home/yunohost.backup/archives folder. It does not work either

I’ve just tested using one app, I’ve tried with two different snapshots, with the same result.

Data is there, but YNH backup restore system does not accept

thank you

---

<div class="post-metadata">

### Author: ![bleeh](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bleeh/32/2741_2.png) [@bleeh](https://forum.yunohost.org/u/bleeh)
#### Post date: [December 3, 2022, 1:16pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/19 "2022-12-03T13:16:51Z")

</div>

Hi, you can check the “Restore from backup” section in [this article](https://gnoobix.net/en/posts/yunohost-backup-with-restic/) I wrote when I published the app (I will add this section to the app documentation, … eventually)

Once you have restored the backup with restic you should be able to do a `yunohost backup restore /path/to/restored/backup --apps app1,app2,...`

---

<div class="post-metadata">

### Author: ![valterbarreira](https://forum.yunohost.org/user_avatar/forum.yunohost.org/valterbarreira/32/2838_2.png) [@valterbarreira](https://forum.yunohost.org/u/valterbarreira)
#### Post date: [February 16, 2023, 2:35pm UTC](https://forum.yunohost.org/t/restic-backup-with-restic/10340/20 "2023-02-16T14:35:20Z")

</div>

I backup my yunohost server to an S3 storage bucket mounted on /mnt/backups, but since a few weeks it is giving errors on some apps, some are made the backup and some don’t.  
Here is a log of one of the apps with error. Also i have installed new apps and they are backing up without error.

args:  
apps:

- my\_webapp  
description: null  
dry\_run: false  
methods:
- restic\_app  
name: auto\_my\_webapp  
output\_directory: null  
system: null  
ended\_at: 2023-02-16 12:58:51.710529  
error: Custom backup method could not get past the ‘backup’ step  
interface: cli  
operation: backup\_create  
parent: null  
related\_to:
- 
  - app
  - my\_webapp  
started\_at: 2023-02-16 12:58:24.017935  
success: false  
yunohost\_version: 11.1.6.2

============

```auto
2023-02-16 12:58:24,049: INFO - Collecting files to be backed up for my_webapp...
2023-02-16 12:58:24,064: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "/var/cache/yunohost/app_tmp_work_dirs/app_jw4nsfc9/scripts/backup" 7>&1']'
2023-02-16 12:58:24,069: DEBUG - + source ../settings/scripts/_common.sh
2023-02-16 12:58:24,069: DEBUG - + source /usr/share/yunohost/helpers
2023-02-16 12:58:24,070: DEBUG - +++ set +o
2023-02-16 12:58:24,070: DEBUG - +++ grep xtrace
2023-02-16 12:58:24,071: DEBUG - ++ readonly 'XTRACE_ENABLE=set -o xtrace'
2023-02-16 12:58:24,071: DEBUG - ++ XTRACE_ENABLE='set -o xtrace'
2023-02-16 12:58:24,085: DEBUG - + ynh_abort_if_errors
2023-02-16 12:58:24,086: DEBUG - + trap ynh_exit_properly EXIT
2023-02-16 12:58:24,086: DEBUG - + ynh_print_info '--message=Loading installation settings...'
2023-02-16 12:58:24,095: INFO - Loading installation settings...
2023-02-16 12:58:24,096: DEBUG - + app=my_webapp
2023-02-16 12:58:24,096: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=final_path
2023-02-16 12:58:24,096: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,121: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,121: DEBUG - ++ [[final_path =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,121: DEBUG - ++ ynh_app_setting get my_webapp final_path
2023-02-16 12:58:24,161: DEBUG - + final_path=/var/www/my_webapp
2023-02-16 12:58:24,161: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=domain
2023-02-16 12:58:24,161: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,182: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,182: DEBUG - ++ [[domain =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,182: DEBUG - ++ ynh_app_setting get my_webapp domain
2023-02-16 12:58:24,225: DEBUG - + domain=domain2.tld
2023-02-16 12:58:24,226: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=db_name
2023-02-16 12:58:24,227: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,245: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,245: DEBUG - ++ [[db_name =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,246: DEBUG - ++ ynh_app_setting get my_webapp db_name
2023-02-16 12:58:24,285: DEBUG - + db_name=my_webapp
2023-02-16 12:58:24,285: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=with_mysql
2023-02-16 12:58:24,286: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,315: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,315: DEBUG - ++ [[with_mysql =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,315: DEBUG - ++ ynh_app_setting get my_webapp with_mysql
2023-02-16 12:58:24,370: DEBUG - + with_mysql=0
2023-02-16 12:58:24,371: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=with_sftp
2023-02-16 12:58:24,371: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,403: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,403: DEBUG - ++ [[with_sftp =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,404: DEBUG - ++ ynh_app_setting get my_webapp with_sftp
2023-02-16 12:58:24,456: DEBUG - + with_sftp=0
2023-02-16 12:58:24,456: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=phpversion
2023-02-16 12:58:24,456: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,486: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,487: DEBUG - ++ [[phpversion =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,487: DEBUG - ++ ynh_app_setting get my_webapp phpversion
2023-02-16 12:58:24,529: DEBUG - + phpversion=8.0
2023-02-16 12:58:24,529: DEBUG - + ynh_print_info '--message=Declaring files to be backed up...'
2023-02-16 12:58:24,540: INFO - Declaring files to be backed up...
2023-02-16 12:58:24,541: DEBUG - + ynh_backup --src_path=/var/www/my_webapp
2023-02-16 12:58:24,572: DEBUG - + dest_path=
2023-02-16 12:58:24,573: DEBUG - + is_big=0
2023-02-16 12:58:24,573: DEBUG - + not_mandatory=0
2023-02-16 12:58:24,573: DEBUG - + BACKUP_CORE_ONLY=0
2023-02-16 12:58:24,573: DEBUG - + test -n my_webapp
2023-02-16 12:58:24,573: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=do_not_backup_data
2023-02-16 12:58:24,573: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,610: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,611: DEBUG - ++ [[do_not_backup_data =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,611: DEBUG - ++ ynh_app_setting get my_webapp do_not_backup_data
2023-02-16 12:58:24,656: DEBUG - + do_not_backup_data=
2023-02-16 12:58:24,656: DEBUG - + '[' '!' -e /var/www/my_webapp ']'
2023-02-16 12:58:24,656: DEBUG - ++ realpath /var/www/my_webapp
2023-02-16 12:58:24,657: DEBUG - + src_path=/var/www/my_webapp
2023-02-16 12:58:24,657: DEBUG - + [[-z '']]
2023-02-16 12:58:24,658: DEBUG - + dest_path=var/www/my_webapp
2023-02-16 12:58:24,658: DEBUG - + [[-e var/www/my_webapp]]
2023-02-16 12:58:24,658: DEBUG - + local rel_dir=/apps/my_webapp/backup
2023-02-16 12:58:24,658: DEBUG - + rel_dir=/apps/my_webapp/backup/
2023-02-16 12:58:24,658: DEBUG - + dest_path=/apps/my_webapp/backup/var/www/my_webapp
2023-02-16 12:58:24,658: DEBUG - + dest_path=apps/my_webapp/backup/var/www/my_webapp
2023-02-16 12:58:24,658: DEBUG - ++ echo /var/www/my_webapp
2023-02-16 12:58:24,658: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,660: DEBUG - + local src=/var/www/my_webapp
2023-02-16 12:58:24,661: DEBUG - ++ echo apps/my_webapp/backup/var/www/my_webapp
2023-02-16 12:58:24,661: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,663: DEBUG - + local dest=apps/my_webapp/backup/var/www/my_webapp
2023-02-16 12:58:24,664: DEBUG - ++ dirname /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/var/www/my_webapp
2023-02-16 12:58:24,666: DEBUG - + mkdir --parents /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/var/www
2023-02-16 12:58:24,668: DEBUG - + ynh_backup --src_path=/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,703: DEBUG - + dest_path=
2023-02-16 12:58:24,703: DEBUG - + is_big=0
2023-02-16 12:58:24,703: DEBUG - + not_mandatory=0
2023-02-16 12:58:24,703: DEBUG - + BACKUP_CORE_ONLY=0
2023-02-16 12:58:24,704: DEBUG - + test -n my_webapp
2023-02-16 12:58:24,704: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=do_not_backup_data
2023-02-16 12:58:24,704: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,736: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,736: DEBUG - ++ [[do_not_backup_data =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,737: DEBUG - ++ ynh_app_setting get my_webapp do_not_backup_data
2023-02-16 12:58:24,784: DEBUG - + do_not_backup_data=
2023-02-16 12:58:24,784: DEBUG - + '[' '!' -e /etc/nginx/conf.d/domain2.tld.d/my_webapp.conf ']'
2023-02-16 12:58:24,785: DEBUG - ++ realpath /etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,787: DEBUG - + src_path=/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,787: DEBUG - + [[-z '']]
2023-02-16 12:58:24,787: DEBUG - + dest_path=etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,787: DEBUG - + [[-e etc/nginx/conf.d/domain2.tld.d/my_webapp.conf]]
2023-02-16 12:58:24,787: DEBUG - + local rel_dir=/apps/my_webapp/backup
2023-02-16 12:58:24,787: DEBUG - + rel_dir=/apps/my_webapp/backup/
2023-02-16 12:58:24,788: DEBUG - + dest_path=/apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,788: DEBUG - + dest_path=apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,788: DEBUG - ++ echo /etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,788: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,792: DEBUG - + local src=/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,792: DEBUG - ++ echo apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,792: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,798: DEBUG - + local dest=apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,799: DEBUG - ++ dirname /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d/my_webapp.conf
2023-02-16 12:58:24,800: DEBUG - + mkdir --parents /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/etc/nginx/conf.d/domain2.tld.d
2023-02-16 12:58:24,803: DEBUG - + '[' 8.0 '!=' none ']'
2023-02-16 12:58:24,803: DEBUG - + ynh_backup --src_path=/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,839: DEBUG - + dest_path=
2023-02-16 12:58:24,839: DEBUG - + is_big=0
2023-02-16 12:58:24,839: DEBUG - + not_mandatory=0
2023-02-16 12:58:24,839: DEBUG - + BACKUP_CORE_ONLY=0
2023-02-16 12:58:24,839: DEBUG - + test -n my_webapp
2023-02-16 12:58:24,839: DEBUG - ++ ynh_app_setting_get --app=my_webapp --key=do_not_backup_data
2023-02-16 12:58:24,840: DEBUG - ++ local _globalapp=my_webapp
2023-02-16 12:58:24,873: DEBUG - ++ app=my_webapp
2023-02-16 12:58:24,874: DEBUG - ++ [[do_not_backup_data =~ (unprotected|protected|skipped)_]]
2023-02-16 12:58:24,874: DEBUG - ++ ynh_app_setting get my_webapp do_not_backup_data
2023-02-16 12:58:24,930: DEBUG - + do_not_backup_data=
2023-02-16 12:58:24,930: DEBUG - + '[' '!' -e /etc/php/8.0/fpm/pool.d/my_webapp.conf ']'
2023-02-16 12:58:24,930: DEBUG - ++ realpath /etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,932: DEBUG - + src_path=/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,932: DEBUG - + [[-z '']]
2023-02-16 12:58:24,932: DEBUG - + dest_path=etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,932: DEBUG - + [[-e etc/php/8.0/fpm/pool.d/my_webapp.conf]]
2023-02-16 12:58:24,932: DEBUG - + local rel_dir=/apps/my_webapp/backup
2023-02-16 12:58:24,932: DEBUG - + rel_dir=/apps/my_webapp/backup/
2023-02-16 12:58:24,932: DEBUG - + dest_path=/apps/my_webapp/backup/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,932: DEBUG - + dest_path=apps/my_webapp/backup/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,932: DEBUG - ++ echo /etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,933: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,935: DEBUG - + local src=/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,935: DEBUG - ++ echo apps/my_webapp/backup/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,936: DEBUG - ++ sed --regexp-extended 's/"/\"\"/g'
2023-02-16 12:58:24,938: DEBUG - + local dest=apps/my_webapp/backup/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,938: DEBUG - ++ dirname /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/etc/php/8.0/fpm/pool.d/my_webapp.conf
2023-02-16 12:58:24,939: DEBUG - + mkdir --parents /home/yunohost.backup/tmp/auto_my_webapp/apps/my_webapp/backup/etc/php/8.0/fpm/pool.d
2023-02-16 12:58:24,941: DEBUG - + ynh_print_info '--message=Backup script completed for my_webapp. (YunoHost will then actually copy those files to the archive).'
2023-02-16 12:58:24,950: INFO - Backup script completed for my_webapp. (YunoHost will then actually copy those files to the archive).
2023-02-16 12:58:24,951: DEBUG - + ynh_exit_properly
2023-02-16 12:58:25,953: DEBUG - Backup permission for my_webapp
2023-02-16 12:58:26,001: DEBUG - initializing ldap interface
2023-02-16 12:58:26,073: INFO - Creating a backup archive from the collected files...
2023-02-16 12:58:26,074: INFO - The archive will contain about 6.9MB of data.
2023-02-16 12:58:26,075: DEBUG - Calling the custom backup method '{method}'...
2023-02-16 12:58:26,075: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "./05-restic_app" need_mount /home/yunohost.backup/tmp/auto_my_webapp auto_my_webapp /home/yunohost.backup/archives 7287203 \'\' 7>&1']'
2023-02-16 12:58:26,082: DEBUG - + set -e
2023-02-16 12:58:26,082: DEBUG - ++ yunohost app setting restic server
2023-02-16 12:58:26,302: DEBUG - + RESTIC_SERVER=localhost
2023-02-16 12:58:26,303: DEBUG - ++ yunohost app setting restic port
2023-02-16 12:58:26,479: DEBUG - + RESTIC_SERVER_PORT=22
2023-02-16 12:58:26,479: DEBUG - ++ yunohost app setting restic ssh_user
2023-02-16 12:58:26,700: DEBUG - + RESTIC_SERVER_USER=root
2023-02-16 12:58:26,700: DEBUG - ++ yunohost app setting restic backup_path
2023-02-16 12:58:26,865: DEBUG - + RESTIC_PATH=/mnt/backups
2023-02-16 12:58:26,866: DEBUG - ++ yunohost app setting restic passphrase
2023-02-16 12:58:27,049: DEBUG - + RESTIC_PASSWORD= ***************
2023-02-16 12:58:27,049: DEBUG - + RESTIC_REPOSITORY_BASE=sftp://root@localhost:22//mnt/backups/
2023-02-16 12:58:27,049: DEBUG - + RESTIC_COMMAND=/usr/local/bin/restic
2023-02-16 12:58:27,049: DEBUG - + LOGFILE=/var/log/restic_backup_restic.log
2023-02-16 12:58:27,049: DEBUG - + ERRFILE=/var/log/restic_backup_restic.err
2023-02-16 12:58:27,050: DEBUG - + work_dir=/home/yunohost.backup/tmp/auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + name=auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + size=7287203
2023-02-16 12:58:27,050: DEBUG - + description=
2023-02-16 12:58:27,050: DEBUG - + case "$1" in
2023-02-16 12:58:27,050: DEBUG - + do_need_mount /home/yunohost.backup/tmp/auto_my_webapp auto_my_webapp 7287203
2023-02-16 12:58:27,050: DEBUG - + work_dir=/home/yunohost.backup/tmp/auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + name=auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + repo=7287203
2023-02-16 12:58:27,050: DEBUG - + size=
2023-02-16 12:58:27,050: DEBUG - + description=
2023-02-16 12:58:27,050: DEBUG - + export RESTIC_PASSWORD
2023-02-16 12:58:27,050: DEBUG - + export RESTIC_REPOSITORY=sftp://root@localhost:22//mnt/backups//auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + RESTIC_REPOSITORY=sftp://root@localhost:22//mnt/backups//auto_my_webapp
2023-02-16 12:58:27,050: DEBUG - + /usr/local/bin/restic list snapshots
2023-02-16 12:58:27,051: DEBUG - ++ tee -a /var/log/restic_backup_restic.log
2023-02-16 12:58:27,051: DEBUG - ++ tee -a /var/log/restic_backup_restic.err
2023-02-16 12:58:27,051: WARNING - tee: /var/log/restic_backup_restic.err: Is a directory
2023-02-16 12:58:27,083: WARNING - subprocess ssh: Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
2023-02-16 12:58:28,111: WARNING - unable to open cache: unable to locate cache directory: neither $XDG_CACHE_HOME nor $HOME are defined
2023-02-16 12:58:32,026: DEBUG - 0d6a96cac907351c662b31dbb9989fdffc5f97f1c768dc2c4f4d57131d77d5db
2023-02-16 12:58:32,027: DEBUG - 11770206f8a867619e64570536b1549b4ecd468997d2ea47e1e7af3936c549b4
2023-02-16 12:58:32,027: DEBUG - 124dbe59be5961ebb14aaedc35fa617eb6adbf6d2bb33b135844b463e95ff151
2023-02-16 12:58:32,027: DEBUG - 1798c25bce00867ff50638121970ad14a7e6ba4051e111d2c93dfb48c30f93fb
2023-02-16 12:58:32,027: DEBUG - 361e4d1962a221788672db4cc82136eb8d5ca736aaa10c70a3d6aefa6e0084f3
2023-02-16 12:58:32,027: DEBUG - 3798db78c607650882bb29d6e90c977d3b542b911a4a815ee5a1f8c6f98aefc9
2023-02-16 12:58:32,027: DEBUG - 3aef01ba13061ed0bffbd4b289b9459a3e86e12079821352a3036d6d6e439c07
2023-02-16 12:58:32,027: DEBUG - 5c08e5435eda603035cc96e6e9d02ac1e708a80335d4b4175f0071d423ed44cc
2023-02-16 12:58:32,027: DEBUG - 6809f0bd0d0be5bf9aa2bbf526a0810968852058e23c54f57d77de44259122ff
2023-02-16 12:58:32,028: DEBUG - 7406cf62acd58a61096e07c6475d0804231c33e9198c985e6330340db0a9e2ba
2023-02-16 12:58:32,028: DEBUG - 79b2829e85aa074fa813e955eec44cf8f334a034c0ebb1a84aa9e9d49777a064
2023-02-16 12:58:32,028: DEBUG - 9e6bac2f6e4550d9275ab0ed7d53fed7f4fcdffd1cc7776516d2034d99c2c344
2023-02-16 12:58:32,028: DEBUG - a11457b5151315364e02acfba95ab5120d67e0d23485ef33d9d9a28d9b5c121f
2023-02-16 12:58:32,028: DEBUG - abe320d736a72b12867ea5421d7d1f8880f7f949844fe255ee55180b216ad804
2023-02-16 12:58:32,028: DEBUG - c2eee4bc1491f538542c4f5caba66cf5dae9ce35c4058b1e28114f1b4d28b047
2023-02-16 12:58:32,028: DEBUG - ce95e37c377fcacd77c3aeb1a8c5769f7f43b51641c58a8b21b057d8d5776396
2023-02-16 12:58:32,028: DEBUG - cf18a59e0ec26b64c297772542264e8034bf3429d1faea1f5498ce02a7545d99
2023-02-16 12:58:32,028: DEBUG - cf53253d127697f5958241a4cc921c90952f99926cab8ddbd930c879e6e5c2bf
2023-02-16 12:58:32,028: DEBUG - d8adca47a53e7f21c5512d78337fefa4c12376e6f8d3ab5c69bd6d9f2b38f18b
2023-02-16 12:58:32,028: DEBUG - db63c7397c19a47f00e3034cf679b37b04b36ec9bd3ecb7199ac904b5f23cc11
2023-02-16 12:58:32,028: DEBUG - f7a675094eaecb4243dc04f954930b09415dba9355b2f4c5f1b719eae62171f9
2023-02-16 12:58:32,028: DEBUG - ff512d411782cd025b5a8dcc0ddd098d78ca38b9630b568056ff21c48ea43511
2023-02-16 12:58:33,329: DEBUG - Executing command '['sh', '-c', '/bin/bash -x "./05-restic_app" backup /home/yunohost.backup/tmp/auto_my_webapp auto_my_webapp /home/yunohost.backup/archives 7287203 \'\' 7>&1']'
2023-02-16 12:58:33,335: DEBUG - + set -e
2023-02-16 12:58:33,336: DEBUG - ++ yunohost app setting restic server
2023-02-16 12:58:33,529: DEBUG - + RESTIC_SERVER=localhost
2023-02-16 12:58:33,530: DEBUG - ++ yunohost app setting restic port
2023-02-16 12:58:33,717: DEBUG - + RESTIC_SERVER_PORT=22
2023-02-16 12:58:33,717: DEBUG - ++ yunohost app setting restic ssh_user
2023-02-16 12:58:33,911: DEBUG - + RESTIC_SERVER_USER=root
2023-02-16 12:58:33,911: DEBUG - ++ yunohost app setting restic backup_path
2023-02-16 12:58:34,111: DEBUG - + RESTIC_PATH=/mnt/backups
2023-02-16 12:58:34,111: DEBUG - ++ yunohost app setting restic passphrase
2023-02-16 12:58:34,323: DEBUG - + RESTIC_PASSWORD= ****************
2023-02-16 12:58:34,324: DEBUG - + RESTIC_REPOSITORY_BASE=sftp://root@localhost:22//mnt/backups/
2023-02-16 12:58:34,324: DEBUG - + RESTIC_COMMAND=/usr/local/bin/restic
2023-02-16 12:58:34,324: DEBUG - + LOGFILE=/var/log/restic_backup_restic.log
2023-02-16 12:58:34,324: DEBUG - + ERRFILE=/var/log/restic_backup_restic.err
2023-02-16 12:58:34,324: DEBUG - + work_dir=/home/yunohost.backup/tmp/auto_my_webapp
2023-02-16 12:58:34,324: DEBUG - + name=auto_my_webapp
2023-02-16 12:58:34,324: DEBUG - + size=7287203
2023-02-16 12:58:34,324: DEBUG - + description=
2023-02-16 12:58:34,324: DEBUG - + case "$1" in
2023-02-16 12:58:34,324: DEBUG - + do_backup /home/yunohost.backup/tmp/auto_my_webapp auto_my_webapp 7287203
2023-02-16 12:58:34,324: DEBUG - + work_dir=/home/yunohost.backup/tmp/auto_my_webapp
2023-02-16 12:58:34,324: DEBUG - + name=auto_my_webapp
2023-02-16 12:58:34,325: DEBUG - + repo=7287203
2023-02-16 12:58:34,325: DEBUG - + size=
2023-02-16 12:58:34,325: DEBUG - + description=
2023-02-16 12:58:34,325: DEBUG - + export RESTIC_PASSWORD
2023-02-16 12:58:34,325: DEBUG - + export RESTIC_REPOSITORY=sftp://root@localhost:22//mnt/backups//auto_my_webapp
2023-02-16 12:58:34,325: DEBUG - + RESTIC_REPOSITORY=sftp://root@localhost:22//mnt/backups//auto_my_webapp
2023-02-16 12:58:34,325: DEBUG - ++ date +%d_%m_%y_%H:%M
2023-02-16 12:58:34,325: DEBUG - + current_date=16_02_23_12:58
2023-02-16 12:58:34,325: DEBUG - + pushd /home/yunohost.backup/tmp/auto_my_webapp
2023-02-16 12:58:34,325: DEBUG - /home/yunohost.backup/tmp/auto_my_webapp /etc/yunohost/hooks.d/backup_method
2023-02-16 12:58:34,325: DEBUG - + /usr/local/bin/restic backup ./
2023-02-16 12:58:34,327: DEBUG - ++ tee -a /var/log/restic_backup_restic.log
2023-02-16 12:58:34,328: DEBUG - ++ tee -a /var/log/restic_backup_restic.err
2023-02-16 12:58:34,329: WARNING - tee: /var/log/restic_backup_restic.err: Is a directory
2023-02-16 12:58:34,362: WARNING - subprocess ssh: Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
2023-02-16 12:58:35,048: WARNING - unable to open cache: unable to locate cache directory: neither $XDG_CACHE_HOME nor $HOME are defined
2023-02-16 12:58:50,694: WARNING - Fatal: load <index/060c134395>: invalid data returned
2023-02-16 12:58:51,695: ERROR - Could not run script: /etc/yunohost/hooks.d/backup_method/05-restic_app
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 298, in hook_callback
    hook_return = hook_exec(
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 385, in hook_exec
    raise YunohostError("hook_exec_failed", path=path)
yunohost.utils.error.YunohostError: Could not run script: /etc/yunohost/hooks.d/backup_method/05-restic_app

```

[Next page](https://forum.yunohost.org/t/restic-backup-with-restic/10340.md?page=2)
