update rclone copy script
This commit is contained in:
@@ -207,11 +207,8 @@
|
||||
name = "rclone-media";
|
||||
runtimeInputs = [ pkgs.inotify-tools pkgs.libnotify pkgs.rclone ];
|
||||
text = ''
|
||||
inotifywait -mr \
|
||||
--format '%w%f' \
|
||||
-e close_write \
|
||||
/mnt/HDD1/Videos/ |
|
||||
while read -r file; do
|
||||
function rclonecopy {
|
||||
file=$1
|
||||
changed_rel=''${file#"/mnt/HDD1/Videos"}
|
||||
notify-send -a "rclone-media" "rclone for $file triggered"
|
||||
if rclone copyto "$file" media:"media-7gM2gcrxRjXqfj$changed_rel" ; then
|
||||
@@ -219,6 +216,14 @@
|
||||
else
|
||||
notify-send -u critical -a "rclone-media" "rclone failed for $file"
|
||||
fi
|
||||
}
|
||||
|
||||
inotifywait -mr \
|
||||
--format '%w%f' \
|
||||
-e close_write \
|
||||
/mnt/HDD1/Videos/ |
|
||||
while read -r file; do
|
||||
rclonecopy "$file"
|
||||
done
|
||||
'';
|
||||
}}/bin/rclone-media";
|
||||
|
||||
Reference in New Issue
Block a user