nanos / FediFetcher

FediFetcher is a tool for Mastodon that automatically fetches missing replies and posts from other fediverse instances, and adds them to your own Mastodon instance.
https://blog.thms.uk/fedifetcher?utm_source=github
MIT License
293 stars 213 forks source link

7.0.5 breaks logging when launched as a cronjob #119

Closed brainsys closed 2 weeks ago

brainsys commented 3 weeks ago

Thank you for adding logging options in 7.0.5.

It works as expected when FedFetcher is run as a bash job on Debian 11. The same options (or none) do not produce logs when run from a crontab. The paths are all absolute and the same job ran successfully on 7.0.4. I suspect there may be a now be a relative link within FediFetcher.

nanos commented 3 weeks ago

Hm, I cannot reproduce this. Personally I do run FediFetcher as a cronjob, and I do continue to get my logs.

Can you please share your crontab setup, as well as your FediFetcher config?

brainsys commented 3 weeks ago

Hi Michael,

This is the script:

cd /home/stuart/FediFetcher python /home/stuart/FediFetcher/find_posts.py --config=/home/stuart/FediFetcher/artifacts/config.json echo -n "FediAll: " >> fedifetcher.log tail -n 1 fedi.tmp >> fedifetcher.log

The tail takes out the last line to add processing time to an overall log. Since 7.0.5 fedi.tmp is opened at every run but not populated when run as a cronjob but does when run from the /home/stuart/FediFetcher directory.

I have tried crontabs as local user and root.

The config (at present):

{ "access_token": ["[redacted]"], "server": "social.brainsys.com", "log-level": "INFO", "home-timeline-length": 200, "max-followings": 80, "from-notifications": 1, "git max-favourites": 40, "lock-hours": 24 }

Regards, Stuart

Brainstorm Systems Limited, 52 Lawrie Park Gardens, London SE26 6XJ. Registered in England No. 2831376 Tel: 020 7043 6866 Web: http://brainsys.com/ Keyserver: https://keys.openpgp.org

On 2024-06-11 13:51, Michael wrote:

Hm, I cannot reproduce this. Personally I do run FediFetcher as a cronjob, and I do continue to get my logs.

Can you please share your crontab setup, as well as your FediFetcher config?

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you authored the thread.Message ID: @.***>

Links:

[1] https://github.com/nanos/FediFetcher/issues/119#issuecomment-2160685899 [2] https://github.com/notifications/unsubscribe-auth/ACMX6SSPZ5VENQOETKOVOXLZG3XFJAVCNFSM6AAAAABJEHJ5D6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRQGY4DKOBZHE

nanos commented 3 weeks ago

Hm. There is nothing in that script that would lead to output being saved to the disk.

The behaviour of the offer hasn’t changed in that log output goes to stdout. So you’d need to redirect it to the log file.

nanos commented 2 weeks ago

closing this now as stale. feel free to re-open if this is still an issue