http://blog.csdn.net/pipisorry/article/details/52464402
#!/bin/sh
# File: ~/bysync.sh
# Author: pipi
# Email: pipisorry@126.com
echo -e "\033[33;1m ***********自定义DIRS=~/SysReinstall ~/files/DESKTOP********* \033[0m"
DIRS=$(echo '~/SysReinstall ~/files/DESKTOP')
echo -e "\033[33;1m ************************************ \033[0m"
echo -e "\033[33;1m ************百度云盘自动同步************ \033[0m"
DATE=`date +%F`
DATE_YEAR=`date +%Y`
DATE_MONTH=`date +%m`
for DIR in $DIRS
do
echo -e "\033[33;1m *****上传$(basename $DIR)****** \033[0m"
bypy mkdir $DATE_YEAR/$DATE_MONTH/$(basename $DIR)
bypy -v syncup $DIR/* $DATE_YEAR/$DATE_MONTH/$(basename $DIR)
# bypy -v syncup $DIR/* $DATE_YEAR/$DATE_MONTH/$(basename $DIR)
done
bypy list
echo -e "\033[33;1m **********百度云盘自动同步完成********** \033[0m"echo -e "\033[33;1m ************************************ \033[0m"