Auto extract archive files
653
A simple nodejs application that watches a specific folder for added files and extracts them if possible.
npm installNavigate to where you cloned the respority and run the application by doing this:
node index.js
If all is well you should see this printed:
Watching directory '.' for added files
Found supported archive file archive.rar
...
By default the application will watch for new files in the current folder (.) and extract to a folder named extracted that is created in the same directory as the found archive. This behaviour can be changed by passing these optional parameters:
node index.js --path downloads --extractFolder unarchived
/etc/system/system/ foldersudo systemctl enable watch-extract and sudo systemctl start watch-extractversion: "3.8"
services:
watch-extract:
image: casperverswijvelt/watch-extract
container_name: watch-extract
environment:
- WATCH_PATH=/watch
volumes:
- /path/to/watch/folder:/watch
restart: unless-stopped
docker run -d \
--name=watch-extract \
-e WATCH_PATH=/watch \
-v /path/to/watch/folder:/watch \
--restart unless-stopped \
casperverswijvelt/watch-extract
extracted folder to
see if an archive has already been extracted or not. Could be improved in the future by keeping track of what has been extracted and what not in a seperate file.Content type
Image
Digest
Size
111.8 MB
Last updated
over 5 years ago
docker pull casperverswijvelt/watch-extract