Backing Up and Auto-Updating Hexo with Dropbox
Original Chinese title: hexo用dropbox备份和自动更新
Installing Hexo
- The official site explains it clearly, so I won’t repeat it here: hexo
- For a Chinese guide, I followed this guy’s post: Hexo Tutorial Series (2): Setting Up a Hexo Blog
- Currently using the Pacman theme
CentOS Dropbox Sync Backup
-
Installing Dropbox on CentOS:
32位系统 $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf - 启动dropbox $ ~/.dropbox-dist/dropboxd- If this is your first time running Dropbox on your server, copy the URL printed in the terminal, open it in a browser, and log in with your Dropbox account to authorize the server. Once authorized, press Ctrl+C to stop the script.
-
Watch out for a possible bug: after the first launch, it sometimes inexplicably stops syncing. In that case, just restart it:
ps aux|grep dropbox kill ~/.dropbox-dist/dropboxd -
Use
lnto symlink the Hexo public folder intowww, e.g.:ln -s /Dropbox/hexo-blog/public /wwwroot/www/web -
Set permissions on the source directory according to your web server’s user and group. If you want to take a shortcut, just
chmod 755the whole Dropbox folder:chmod 755 ~ chmod 755 ~/Dropbox
That’s about it
hexo 安装
- 官网很清楚了,就不再多述了 hexo
- 中文的,我参照的是这个哥们 hexo系列教程:(二)搭建hexo博客
- 模板目前用 Pacman
Centos Dropbox 同步备份
-
Centos Dropbox 安装
32位系统 $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf - 启动dropbox $ ~/.dropbox-dist/dropboxd- 如果你是第一次在你的服务器上运行Dropbox,复制提示的链接在浏览器中打开,用你的Dropbx用户登录即可完成对服务器的授权。完成授权后,Ctrol+C中断这个脚本。
-
可能会有一个bug :第一次启动之后莫名就不同步。这时候需要重启一下。
ps aux|grep dropbox kill ~/.dropbox-dist/dropboxd -
通过ln 来把hecto public文件夹同步到www里面 e.g
ln -s /Dropbox/hexo-blog/public /wwwroot/www/web -
根据你的server的用户名和组配置源文件权限。如果偷懒就直接吧dropbox整个文件夹chmod 755
chmod 755 ~ chmod 755 ~/Dropbox