Open cburgdorfer opened 1 year ago
I'm having a similar issue on a new OS X Ventura install, except I get zero output at all in cron - even the echo
statements that precede the invocation of imagesnap
don't get routed to my mailbox or anywhere else.
I had a similar issue with a previous version of OSX, but didn't manage to write down how I solved it!
I believe it's due to how permissions are now handled in OSX, but that doesn't help me much.
Someone I know linked me to these two sources, which I guess I'll try later tonight:
Oh, damn, I remembered how I fucking got around that!
The cron task sent a command to an always-running tmux server that tells it to create a new pane, and then run the command inside it.
It's absolutely stupid, but it absolutely worked.
For posterity, my invocation is something like this: */20 * * * * /usr/local/bin/tmux new-window -t startup ~/bin/something 2>&1 >> ~/something.log
Where startup
is a named and running tmux server.
hi, I was just curious, has anyone managed to run this from a cron tab on macos x? I seem to get stuck.
When I run the command:
/usr/local/bin/imagesnap /Users/username/Documents/Projects/Timelapse/snapshot_$(date +\%Y\%m\%d\%H\%M\%S).jpg
manually, it captures it correctly including adding the date and time to the filename.
If I run the command from within a shell script, it works as well.
But if I run the command or the shell script from a cron tab, it wouldn't work. It would omit the part between the two s /Users/username/Documents/Projects/Timelapse/snapshot_20221220184251.jpg* below and no picture is being captured:
Any ideas how to solve this?
Thanks!