git-sync icon indicating copy to clipboard operation
git-sync copied to clipboard

Automated on system startup :: same as #12 Perpetual Mode??

Open Whyglobaleyes opened this issue 2 years ago • 2 comments

Hello, Thanks a lot for writing a great utility and usual apologies for not being very good with understanding linux.

I'm trying to use a modified version of git-sync-on-inotify and make it launch on startup so that I don't have to remember to start it when I modify files in the git local-dir.

  1. I've tried (a) creating a crontab job to run @reboot
  2. and (b) creating a systemd unit - but despite both methods appearing to start gsoi, neither method actually does any syncing.
  3. I can manually initiate gsoi - either (a) with no other instance running, (b) with a crontab'ed instance already running but failing to sync or (c) with a systemd'ed instance running but failing - and in any of those situations the manually initiated version runs beautifully.
  4. I've tried adding a looong sleep delay on the crontab version. @reboot sleep 300 /bin/bash /home/a/dotfiles/homebin/git-sync_dotfiles-on-inotify
  5. I've tried launching a shell ro run the script. @reboot /bin/bash -c /bin/bash /home/a/dotfiles/homebin/git-sync_dotfiles-on-inotify

I know this sounds more like a crontab/ systemd issue but other crontab jobs are running fine (never messed with systemd before) .... any ideas what I'm doing wrong (I know this sounds more like a crontab/ systemd issue. thanks

Whyglobaleyes avatar Jul 08 '22 13:07 Whyglobaleyes

Hi, sorry for not noticing earlier.

I guess you are experiencing some form of a permissions problem. Are you using your local user's ("a"?) crontab? If not, git may be missing credentials or configuration. I don't know about a systemd equivalent for that.

I suggest piping stdout/stderr to some file to capture the output and see what it contains.

simonthum avatar Jul 23 '22 14:07 simonthum

Thanks for the tips :: same user for git & crontab :: didn't think of saving the stdout/err - will try that one day but TBH it's already become muscle memory to start it manually when I start editing files in my git repo. bw Y

Whyglobaleyes avatar Jul 26 '22 08:07 Whyglobaleyes