git-sync
git-sync copied to clipboard
Automated on system startup :: same as #12 Perpetual Mode??
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.
- I've tried (a) creating a crontab job to run @reboot
- and (b) creating a systemd unit - but despite both methods appearing to start gsoi, neither method actually does any syncing.
- 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.
- 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
- 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
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.
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