Update move_downloads.sh
Esse commit está contido em:
@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#moves all incoming files (e. g. downloads) to another directory.
|
#Hardlinks all incoming files (e. g. downloads) to another directory.
|
||||||
#There, they will be put into subdirectories which are named after the current date (YYYYMMDD) to get some minimal automatic "organization".
|
#There, they will be put into subdirectories which are named after the current date (YYYYMMDD) to get some minimal automatic "organization".
|
||||||
#adhocify -d -m IN_CLOSE_WRITE -m IN_MOVED_TO -w /home/user/Downloads -w /home/user/other_dir /path/to/move_downloads.sh
|
#adhocify -d -m IN_CLOSE_WRITE -m IN_MOVED_TO -w /home/user/Downloads -w /home/user/other_dir /path/to/move_downloads.sh
|
||||||
|
|
||||||
@ -16,7 +16,8 @@ mkdir "$TODAY_DIR"
|
|||||||
rm -f "$TARGET_DIR"/today
|
rm -f "$TARGET_DIR"/today
|
||||||
ln -s "$TODAY_DIR" "$TARGET_DIR"/today
|
ln -s "$TODAY_DIR" "$TARGET_DIR"/today
|
||||||
fi
|
fi
|
||||||
#You can also filter/grep the filename here and move certain patterns to other designated locations...
|
# Nowadays, some browsers don't like it when files are moved away immediately and might report download failure. Use hardlinks so they don't complain.
|
||||||
mv "$INCOMING" "$TARGET_DIR"/$today/
|
# Alternatively, a sufficiently long enough "sleep" followed by "mv" might work
|
||||||
|
ln "$INCOMING" "$TARGET_DIR"/$today/
|
||||||
|
|
||||||
|
|
||||||
|
Referência em uma nova issue
Block a user