我正在尝试创建一个BASH脚本来备份到外部驱动器。我会运行这个脚本来检查连接哪个驱动器,然后运行rsync。我是BASH的新手,并不能完全弄清楚它是否是其他人。谁能帮忙?我在想的是。bash if then else if back up to two drives
If [ /Volumes/Drive_1]
then
sudo rsync -avx /Volumes/1/2\ __3__/ /Volumes/Drive_1
else
If [ /Volumes/Drive_2]
then
sudo rsync -avx /Volumes/1/2\ __3__/ /Volumes/Drive_2
fi
为什么另起炉灶呢?有很多很棒的备份工具/脚本,如果需要的话,其中许多可以使用'rsync'作为后端。 –