Run mount command as normal user in a script

Hi,

I’m currently writing a shell script for incremental backups on an external hard disk, for a desktop PC running Rocky Linux 8 with a single user.

Script is almost working perfectly. It uses rsnapshot under the hood, which uses a nifty combination of rsync and hard links to make incremental backups.

I’m missing one last thing for it to work. So far I can manage to run it as a normal user (bernard).

When I open Dolphin and click on an external hard disk, I can “mount” it in graphic mode.

How would I perform the same operation on the command line, e. g. mount an external hard disk as a normal user ?

The fstab mount options had “user” or something?

The other option would be automounting (set up as root, but mounts when you try to access the path).

2 Likes

Putting user in the fstab options did the trick. Thanks !