Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mount Samba and Clone using rclone
#!/bin/bash
IP=XXXXX
USERNAME="Emanuele%20Ruffaldi"
SHARE_NAME="Emanuele%20Ruffaldi"
MOUNT_POINT=$HOME/mnt/smb
# ask for password
read -s -p "Password: " PASSWD
if [ ! -d "$MOUNT_POINT" ]
then
mkdir $MOUNT_POINT
fi
if mount | grep "on $MOUNT_POINT" > /dev/null; then
echo "already mounted"
else
mount -t smbfs "//${USERNAME}:${PASSWD}@${IP}/${SHARE_NAME}" "${MOUNT_POINT}"
fi
if mount | grep "on $MOUNT_POINT" > /dev/null; then
rclone copy gdrive: $MOUNT_POINT/gdriveclone
else
echo "not mounted"
fi
umount $MOUNT_POINT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.