互联网技术博客

Shell脚本-监听并自动进行硬盘挂载

Shell脚本-监听并自动进行硬盘挂载

#!/bin/bash
time=$(date “+%Y-%m-%d %H:%M:%S”)
if grep -qs ‘/dev/sdb’ /proc/mounts;
then
echo -e “$time” CloudDisk Mount >> /tmp/mounted.log
else
mount /dev/sdc /www/wwwroot/disk.tanyuecn.com/cloudreve/public/uploads/
fi

if grep -qs ‘/dev/sdc’ /proc/mounts;
then
echo -e “$time” GitDisk Mount >> /tmp/mounted.log
else
mount /dev/sdb /var/opt/gitlab/git-data/repositories/
fi

 

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注