-
Notifications
You must be signed in to change notification settings - Fork 12
How to monitor a folder in background
This can be easily done with scripts, there's no point in making it part of NewsUP. But since this is a feature that is always being requested, i'm posting an example of how to achieve this. This script is working with NewsUP, but is very easily changed to support other command line clients.
Please also take a look into the page how to share torrents
Assuming that you have a newsup installation working (that you can invoke newsup
on the command line), you can use the following script:
https://gist.github.com/demanuel/ebcc0bd34c13b05fe1b422169a4a593c
To use it:
-
download it
-
chmod +x newsup_monitor.sh
-
./newsup_monitor.sh -d <folder_that_you_want_to_monitor>
if you want to stop monitoring the folder: ./newsup_monitor.sh -s
If you don't use newsup, you can still use this script, just change the lines 82, 93, 99 and 144, to whatever command line uploader you use.
-
The folders/files must have be modified at least 2 minutes ago (to avoid start uploading while the folder is still being updated)
-
Every time you start the script, it will consider the files inside the folder as new and will upload them. The goal, is to start once and leave it running forever.
-
Only the first level folders/files are considered. If you add a file inside
<folder_that_you_want_to_monitor>/<already_uploaded_folder>/<new_file>
it won't find the file and it won't upload the<alread_uploaded_folder>
again.