Avoid using BusyBox stat on Synology DSM
This commit is contained in:
parent
f3182973d9
commit
5f85b35a22
|
@ -55,7 +55,12 @@ for home_dir in "${BACKUP_ROOT}"/*; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "${home_dir}/${FILES_DIR}"
|
cd "${home_dir}/${FILES_DIR}"
|
||||||
owner=$(stat -c '%U' .)
|
stat_cmd="stat"
|
||||||
|
# avoid using BusyBox stat on Synology
|
||||||
|
if [ -x /opt/bin/stat ]; then
|
||||||
|
stat_cmd="/opt/bin/stat"
|
||||||
|
fi
|
||||||
|
owner=$(${stat_cmd} -c '%U' .)
|
||||||
|
|
||||||
su - "${owner}" -c "rsnapshot -c '${home_dir}/rsnapshot.conf' '$1'"
|
su - "${owner}" -c "rsnapshot -c '${home_dir}/rsnapshot.conf' '$1'"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue