SOLVED! – Trigger "File Observer" stops after execution

Post your questions and help other users.

Moderator: Martin

Post Reply
Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

SOLVED! – Trigger "File Observer" stops after execution

Post by Karl-Heinz » 15 Dec 2018 17:52

Hey guys!

Apparently, I don't understand Automagic's concept in this regard:

How can I make sure that a "file observing" trigger stays active even after it has been triggered/executed?

I want to monitor/observer a folder and move new files automatically somewhere else. My problem is, that in contrast to other flows (like "if 11pm, turn off automatic sync"), the flow "move files" stops working after execution and trigger listening has to be started manually again.

Would be great if someone can give an answer or point me to an existing explanation. Thanks!

– Karl-Heinz
Last edited by Karl-Heinz on 15 Dec 2018 18:00, edited 1 time in total.

Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

Re: Trigger "File Observer" stops after execution

Post by Karl-Heinz » 15 Dec 2018 18:00

Veeery strange: I thought it didn't work… but now it suddenly works. :D

Maybe it was because Automagic restarted when I wanted to switch from German to English interface to provide you with English screenshots.

I updated the title. :)

Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Karl-Heinz » 15 Dec 2018 18:01

But: I still don't know what was wrong before / how Flow or Trigger settings have to be to automatically restart after execution. :)

User avatar
Bingwu
Posts: 114
Joined: 26 Feb 2016 10:26

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Bingwu » 15 Dec 2018 19:05

Hello Karl-Heinz!

A speculation! Is it possible that the directory to be monitored did not exist when the trigger was created?
That would be a reason the trigger does not trigger.

I already had my problems with that. (viewtopic.php?f=5&t=6937)

Regards
Peter

Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Karl-Heinz » 15 Dec 2018 20:46

Servus! Danke für deine Antwort!

Yeah, it could have been because of that. But I thought I made a smartphone restart in the meantime. And definitely the folder existed when I manually restarted it, maybe also when I created the flow originally.

So, it still seems strange. :)

But it works now very well and fast.

One different questions, since you're here: Should I set some variables to save some battery? Like... Checking only every 1-2 seconds instead of every millisecond (or whatever Automagic does)?

User avatar
Bingwu
Posts: 114
Joined: 26 Feb 2016 10:26

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Bingwu » 15 Dec 2018 22:39

Hello Karl-Heinz!

Regarding the battery consumption, I can not tell you any incidents.
Other users can give you more information about this!

In the end I'm working more with the trigger "App Task Ended", because that makes more sense to me, since most file operations are caused by an app.

Example:
If I take photos with the Karmera, the Trigger "File Observer" must trigger after each captured image.
But that is not necessary and caused problems with serial photos.
The "App Task Ended" trigger (camera) is better for this.

Regards
Peter
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Hallo Karl-Heinz!

Bezüglich des Akkuverbrauchs kann ich dir keine Auffäligkeiten nennen.
Andere User könnenen dir hierzu vielleicht mehr Angaben machen!

Ich arbeite letztendlich mehr mit dem Trigger "App Task Beendet", da das für mich meistens sinnvoller ist, da die meisten Dateioperationen aufgrund einer App entstehen.
Beispiel:
Wenn ich mit der Karmera Photos mache, muß der Trigger "Datei Überwacher" nach jedem aufgenommenen Bild auslösen.
Das ist aber nicht notwendig und führte bei Serienphotos zu Problemen.
Der Trigger "App Task Beendet" (Kamera) ist hierfür besser geeignet.

Gruß
Peter

Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Karl-Heinz » 15 Dec 2018 23:02

Ah, ok.

That wouldn't work for me, since it's screenshots I want to move. So Kamera is not related.

But maybe I find the right application whose App Tasks Automagic could observe to trigger moving new screenshots to a different folder.

Thanks so far, Peter!

User avatar
Desmanto
Posts: 2395
Joined: 21 Jul 2017 17:50

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Desmanto » 16 Dec 2018 13:45

If you change any parameter in the File observer trigger, you have to disable the flow and reenable it again. So it will reobserve with the new path. Restarting phone also restart automagic, hence reenable the monitoring with new parameter.

Regarding battery, File observer is an event trigger. It only react to the event. But you should configure it properly, many apps use different configuration to denote the end of file writing. AFAIK it will use the built-in media scanner to detect the new file. So if you use only the last proper event trigger for the file, it only detect one event per each screenshot, not checking the folder for the whole time. So should be no battery drain at all. Probably Writable file closed or Subfile created will work.

Other case not related to automagic; I have use RR ROM at my current phone, RN5 whyred. There is a version of the ROM which has the wifi continuous logging, writing to the /sdcard/wifi folder. The logging run all the time as long as the wifi is active. And there is no visible battery drain even though it is running all the time. So if the observed folder is in internal storage, and event configured properly; there should be no battery drain at all. It will be different if you monitor the microsd, since idle microsd access will drain about 30 mA and up to 100 mA when active. For a 3000 mA phone, this is about 1-3% idle drain per hour,
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200117 Official, Android Pie 9.0, Rooted.

Karl-Heinz
Posts: 6
Joined: 11 Dec 2018 13:36

Re: SOLVED! – Trigger "File Observer" stops after execution

Post by Karl-Heinz » 16 Dec 2018 14:09

Oh, thanks, Desmanto!!

Will play around with trigger settings a bit.

Post Reply