Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Monitor directory #458

Open
danboid opened this issue Sep 17, 2022 · 4 comments
Open

[FR] Monitor directory #458

danboid opened this issue Sep 17, 2022 · 4 comments
Labels
feature request Proposal for new features

Comments

@danboid
Copy link

danboid commented Sep 17, 2022

Is your feature request related to a problem? Please describe.

I use ZGCAM as a camera but, like gcam, its main issue for me is it doesn't give me the option to save pictures and videos to my microSD card which I'd prefer because I'd still be able to access those files if my phone broke.

Describe the solution you'd like

I would like Easer to have the ability to monitor a directory for files and then run a command when new files appear in that directory. In my case I want to move all (new) files in my DCIM/Camera dir to my uSD card.

Describe alternatives you've considered [optional]

gcam tool - Non free and not very reliable from the reviews I've read online.

It might be possible to do what I want by running two instances of syncthing on different ports but thats a bit messy as it doesn't support syncing local dirs.

Under desktop/server Linux you can achieve this with a systemd service or using inotifywait. it seems Android has a class called FileObserver for this that uses inotify:

https://developer.android.com/reference/android/os/FileObserver

"Each FileObserver instance can monitor multiple files or directories. If a directory is monitored, events will be triggered for all files and subdirectories inside the monitored directory."

@danboid danboid added the feature request Proposal for new features label Sep 17, 2022
@danboid
Copy link
Author

danboid commented Sep 17, 2022

I may give the android port of inotifywait a try, if I can get it to build. There doesn't seem to be any pre-built apks for it.

https://github.com/dstmath/inotifywait-for-Android

@danboid
Copy link
Author

danboid commented Sep 17, 2022

One way to achieve what I want would be to root my phone, install busybox and then create a cron job to move the files every 15 minutes or so as described here:

https://android.stackexchange.com/questions/140162/creating-a-cron-job-on-android

I'm going to try doing this with easer first but will easer be able to do this automatically in the background, without having to have my phone in a fully on/active state for it to work?

@danboid
Copy link
Author

danboid commented Sep 18, 2022

There is also a crond app available via fdroid which looks like a better solution than using busybox but it also requires root.

https://github.com/Faerbit/android-crond

@danboid
Copy link
Author

danboid commented Sep 25, 2022

crond didn't work for my purposes but a dev who had forked crond took pity on me and very quickly wrote a whole new open source Android app specifically for moving files from one dir to another called MoveFiles:

https://github.com/a1291762/MoveFiles

MoveFiles can be easily installed from the devs f-droid repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Proposal for new features
Projects
None yet
Development

No branches or pull requests

1 participant