Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify where to invoke systemctl, provide example #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,56 @@ directory (in this case the `$HOME/google-drive`):
First install the `inotify-tools` (seems to be named like that in all major distros):
test that it works by calling `inotifywait -h`.

Prepare a Google Drive folder in your $HOME directory with `grive -a`.
Ensure you have first initialized a Google Drive folder per the instructions in the usage section.
Execute these commands from the directory above the folder you are using. In the example below,
`google-drive` was initialized inside the user `$HOME` directory.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it should not matter where you execute these commands in.


```bash
# 'google-drive' is the name of your Google Drive folder in your $HOME directory
systemctl --user enable grive-timer@$(systemd-escape google-drive).timer
systemctl --user start grive-timer@$(systemd-escape google-drive).timer
systemctl --user enable grive-changes@$(systemd-escape google-drive).service
systemctl --user start grive-changes@$(systemd-escape google-drive).service
```

For example:
```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a nice tutorial this can link to? It's basically explaining how systemctl --user works under the hood and has nothing to do with grive itself.

$ systemctl --user enable grive-timer@$(systemd-escape google-drive).timer
Created symlink /home/<user>/.config/systemd/user/timers.target.wants/grive-timer@google\x2ddrive.timer → /usr/lib/systemd/user/[email protected].
$ systemctl --user start grive-timer@$(systemd-escape google-drive).timer
$ systemctl --user enable grive-changes@$(systemd-escape google-drive).service
Created symlink /home/<user>/.config/systemd/user/default.target.wants/grive-changes@google\x2ddrive.service → /usr/lib/systemd/user/[email protected].
$ systemctl --user start grive-changes@$(systemd-escape google-drive).service
```

You can check the status of these services as so:
```
$ systemctl --user status grive-timer@$(systemd-escape google-drive).timer
● grive-timer@google\x2ddrive.timer - Google drive sync (fixed intervals)
Loaded: loaded (/usr/lib/systemd/user/[email protected]; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-09-06 13:16:33 EDT; 9min ago
Trigger: n/a
Triggers: ● grive-timer@google\x2ddrive.service

$ systemctl --user status grive-timer@$(systemd-escape google-drive).service
● grive-timer@google\x2ddrive.service - Google drive sync
Loaded: loaded (/usr/lib/systemd/user/[email protected]; static; vendor preset: enabled)
Active: active (running) since Sun 2020-09-06 13:16:33 EDT; 10min ago
TriggeredBy: ● grive-timer@google\x2ddrive.timer
Main PID: 124255 (grive-sync.sh)
Memory: 3.0G
CGroup: /user.slice/user-1000.slice/[email protected]/grive\x2dtimer.slice/grive-timer@google\>
├─124255 /bin/bash /usr/lib/grive/grive-sync.sh sync google\x2ddrive
├─124295 grive -p google-drive
└─124296 grep -v -E ^Reading local directories$|^Reading remote server file list$|^Syn>

Sep 06 13:26:59 pop-os grive-sync.sh[124296]: sync "somefolder/somepath"
```

Tail the service unit to gauge the current activity:
```
journalctl --user -f -u grive-timer@$(systemd-escape google-drive).service
```

You can enable and start these two units for multiple folders in your `$HOME`
directory if you need to sync with multiple google accounts.

Expand Down