Linux下CLI模式使用Dropbox

下载Dropbox 32-bit: cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf - 64-bit: cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - 连接到Dropbox ~/.dropbox-dist/dropboxd 按照提示,在浏览器中打开链接,确认授权。 CLI模式使用Dropbox 下载执行脚本: wget https://www.dropbox.com/download?dl=packages/dropbox.py chmod +x dropbox.py dropbox.py使用 root@hkvps:~# ./dropbox.py help Dropbox command-line interface commands: Note: use dropbox help <command> to view usage for a specific command. status get current status of the dropboxd help provide help puburl get public url of a file in your dropbox stop stop dropboxd running return whether dropbox is running start start dropboxd filestatus get current sync status of one or more files ls list directory contents with current sync status autostart automatically start dropbox at login exclude ignores/excludes a directory from syncing lansync enables or disables LAN sync

八月 19, 2014 · JQX

VPS下自动备份文件和数据库

新建脚本,名为autoback.sh vi autoback.sh 脚本autoback.sh内容如下: #!/bin/sh #备份网站目录/home/www/ tar zcvf /home/backup/www$(date + "%Y%m%d").tar.gz /home/www/* #备份数据库 www /usr/local/mysql/bin/mysqldump -uroot -ppassword dbname > /home/backup/dbname$(date +"%Y%m%d").sql #删除三天前的备份 cd /home/backup/ rm -f *$(date -d -3day +"%Y%m%d")* 将脚本(autoback.sh)添加到自动执行任务列表: chmod +x autoback.sh crontab -e 59 23 * * * /root/autoback.sh 推荐注册Dropbox,参考 Linux下CLI模式使用Dropbox,将备份文件自动同步到Dropbox。

一月 13, 2014 · JQX