Changing data directory breaks backup possibility on snap installation

Hi everyone.

After installing nextcloud via snap I configured the data directory to an external volume. This is great because I can resize this volume.

Now I also do automatic backups every day with nextcloud.export. This worked fine until I changed the data dir. Now I am getting the error:

Exporting database...
Exporting config...
Exporting data...
rsync: change_dir "/var/snap/nextcloud/common/nextcloud/data" failed: No such file or directory (2)
              0 100%    0.00kB/s    0:00:00 (xfr#0, to-chk=0/0)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1196) [sender=3.1.2]
Unable to export data

The only thing I find online is that snap might not be able to handle this and that I should back up the data myself:

That would be really cumbersome and I also think it’s not good practice to split the backups into two parts. Isn’t there another way? Can I not somehow tell snap to change the default path?

Thanks for any help. Very much appreciated.

1 Like

For future readers: Seems like there is no solution to this… had to back up my data with a shell script myself


Good evening!

Found solution:
We do NOT change the nexcloud settings - we leave them as standard
We mount the external device in mount . We connect at boot - in the file /etc/fstab
in place of the ‘datadirectory’ and /vsr/snap/
*/backup directories, create a simlink to the directories of the external device
“OrangePi + snap nexcloud” + external HDD = month - normal flight :slight_smile:
standard backup procedures work

Linux experience - “regular user” :slight_smile:
Can this approach create problems?
sorry for my English

The snap of Nextcloud is known to be rather inflexible. It’s really only for very basic setups. If you modify it like this, expect to make some accommodations.