You are not logged in.
Hey friends, what would folks here recommend as the most graceful means of auto-connecting to Google Drive once a network connection has been established?
I'm thinking some sort of systemd script that relies on systemd-networkd-wait-online.service ... but am not 100% sure and could use a hand
What I want to do is, as my user (i.e., _not_ as root), run the following command when the network connects:
gdfs -o allow_other default ~/Google\ Drive
And then I would like to automatically unmount the directory once the network disconnects or there's a shutdown/reboot command. I've confirmed the above command works as expected.
Thoughts/advice? Thanks!
Offline
Why not rclone?
Offline
Why not rclone?
While that didn't fix the auto-mount question I posed earlier, this /did/ lead me down an rclone rabbit hole and now I have gdrive/dropbox/mega all working with it But I'd still like to find a way to auto-mount them to my user directories upon establishment of network connection and then automatically unmount when the connection goes away.
Offline
You can make a automount file and activate with systemd. Look at the wiki...
Offline
cat /etc/systemd/system/home-backup.automount
[Unit]
Description=Automount Backup
[Automount]
Where=/home/backup
[Install]
WantedBy=multi-user.target
[morta@5erver ~]$ cat /etc/systemd/system/home-backup.mount
[Unit]
Description=Mount NFS Backup at boot
[Mount]
What=192.168.11.96:/export/Backup_Server
Where=/home/backup
Options=vers=3
Type=nfs
TimeoutSec=30
[Install]
WantedBy=multi-user.target[morta@5erver ~]$
Is a sample for a nfs3 share. It's boot automatically after the network is up...
Last edited by Morta (2021-11-07 18:02:52)
Offline
I use rclone to mount my drive on a directory. After i configured it to be able to mount it
I started this on plasma in service at startup
rclone mount MyDrive: /home/user/MyGoogleDrive
Offline
I made a simple systemd script (~/.config/systemd/user/rclone-mount-gdrive.service):
[Unit]
Description=RClone Google Drive Mount Service
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
StandardOutput=journal
ExecStart=/usr/bin/rclone mount "Google Drive:" "~/Google Drive"
[Install]
WantedBy=default.target
Seems to work ok. *shrug*
Edit - this does _not_ work upon initial login. I have to manually --user start the service (even though it's enabled) for it to mount the drive.
Last edited by cloverskull (2021-11-07 23:50:50)
Offline