mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Try to remount directory as read-only in ynh_backup (wip #298)
This commit is contained in:
parent
923d72814b
commit
36a8a2d278
1 changed files with 4 additions and 0 deletions
|
@ -38,6 +38,10 @@ ynh_backup() {
|
|||
eval $SUDO_CMD mkdir -p "${DESTPATH}"
|
||||
|
||||
if sudo mount --rbind "${SRCPATH}" "${DESTPATH}"; then
|
||||
# try to remount destination directory as read-only
|
||||
sudo mount -o remount,ro "${DESTPATH}" \
|
||||
|| sudo mount -o remount,ro,bind "${SRCPATH}" "${DESTPATH}" \
|
||||
|| true
|
||||
return 0
|
||||
else
|
||||
CAN_BIND=0
|
||||
|
|
Loading…
Add table
Reference in a new issue