Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
sync_scripts_in_bin_via_nextcloud_between_linux_systems [01.07.2021 14:14] – ["why didn't you..."] Pascal Suter | sync_scripts_in_bin_via_nextcloud_between_linux_systems [01.07.2021 16:28] (current) – Pascal Suter | ||
---|---|---|---|
Line 15: | Line 15: | ||
sudo apt install fuse-posixovl | sudo apt install fuse-posixovl | ||
- | I then created | + | unfortunately though, posixovl does not provide a mount compatible ''/ |
- | <code bash Nextcloud/ | + | |
+ | Since I wanted this directory to be mounted automatically, | ||
+ | |||
+ | I found the solution on [[https:// | ||
+ | - the original binary had to be renamed --> cumbersome when doing updates in the future through apt | ||
+ | - mount.posixovl.orig was started | ||
+ | |||
+ | so i slightly modified the script and saved it to ''/ | ||
+ | <code bash mount.fuse-posixovl> | ||
#!/bin/bash | #!/bin/bash | ||
- | # cleanup .pxovl.* files for which the actual file has been deleted | + | # wrapper |
- | # this .pxovl.* files save access rights etc to files for the posix | + | # with this wrapper posixovl |
- | # augmentation, | + | |
- | # deleted the .pxovl.* file remains there, which can lead to problems | + | |
- | # when a new file with the same name is created and immediately | + | |
- | # takes the attributes of the old file | + | |
- | SOURCE=$HOME/Nextcloud/ | + | # location of the original mount.posixovl |
- | TARGET=$HOME/bin | + | origposixovl="/sbin/mount.posixovl" |
- | if ! mountpoint | + | # gather inputs |
- | for i in $(find $SOURCE/ | + | while [ $# -gt 0 ]; do |
- | if ! [ "$(basename $i)" == ".pxovl." | + | if [[ "$1" == -* ]]; then |
- | | + | # var is an input switch |
- | rm -f $SOURCE/$i; | + | # we can only use the -o or -F switches |
- | fi; | + | if [[ "$1" |
- | done | + | optsF=" |
+ | else | ||
+ | optsF="" | ||
+ | fi | ||
+ | if [[ "$1" == *o* ]]; then | ||
+ | shift | ||
+ | if [[ "$1" | ||
+ | runas=$(getent passwd | ||
+ | fi | ||
+ | optsfuse=" | ||
+ | else | ||
+ | optsfuse="" | ||
+ | fi | ||
+ | shift | ||
+ | else | ||
+ | # var is a main argument | ||
+ | sourcedir=" | ||
+ | shift | ||
+ | if [[ " | ||
+ | | ||
+ | shift | ||
+ | else | ||
+ | targetdir=" | ||
+ | fi | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | # verify inputs | ||
+ | if [ "$sourcedir" | ||
+ | echo "no source specified" | ||
+ | exit 1 | ||
+ | fi | ||
+ | if [ " | ||
+ | echo "no target specified" | ||
+ | exit 1 | ||
+ | fi | ||
- | | + | # build mount.posixovl command |
- | | + | if [[ -n "$runas" ]]; then |
- | | + | su - "${runas}" |
+ | else | ||
+ | " | ||
fi | fi | ||
</ | </ | ||
- | now I simply | + | now I added this line to fstab and voilà |
- | | + | / |
- | which works like a charm. | + | |
+ | (i don't think the '' | ||
+ | | ||
===== "why didn't you..." | ===== "why didn't you..." | ||
... simply create a startup script that runs '' | ... simply create a startup script that runs '' |