E**a 发帖数: 275 | 1 掌中宝外设,JR上19.99那个P21 black实际上是E02。
发信人: Exia (漂流瓶), 信区: Hardware
标 题: PogoPlug安装Dropbox攻略(部分原创)
发信站: BBS 未名空间站 (Sat Dec 1 06:05:21 2012, 美东)
初衷:原本想用pogoplug架个surveillance webcam,然后把video stream和snapshots
自动上传到dropbox(之所以用dropbox,是因为这个不需要安装客户端,其他的软件俺
暂时没找到解决方案). 用lsusb和hwinfo都能看到我的6年老的logitech quickcam pro
for notebook,但motion始终无法打开/dev/video0,用ls /dev/video*查看竟然无
video device,真tm奇怪。
下面姑且把dropbox搞定:
1. 下载dropbox_uploader的bash script(这个非原创,非常赞的script)
https://github.com/andreafabrizi/Dropbox-Uploader
这个bash script不需要你的dropbox的账号密码
2. 解压上传到Pogoplug里某个文件夹,e.g., /mnt/DropboxUl,其中包含Readme和
dropbox_uploader.sh
3. 首次运行并设置Dropbox帐号关联:
-----------------------------------------------------------------------
root@Pogo:/mnt/DropboxUl# ./dropbox_uploader.sh info
This is the first time you run this script.
Please open this URL from your Browser, and access using your account:
-> https://www2.dropbox.com/developers/apps
If you haven't already done, click "Create an App" and fill in the
form with the following data:
App name: MyUploader123456789
Description: What do you want...
Access level: App folder or Full Dropbox
Now, click on the "Create" button.
When your new App is successfully created, please type the
App Key, App Secret and the Access level:
# App key: ***************
# App secret: ***************
# Access level you have chosen, App folder or Full Dropbox [a/f]: a
> App key is ***************, App secret is *************** and Access level
is App Folder, it's ok? [y/n]y
> Token request... OK
Please visit this URL from your Browser, and allow Dropbox Uploader
to access your DropBox account:
--> https://www2.dropbox.com/1/oauth/authorize?oauth_token=***************
Press enter when done...
> Access Token request... OK
Setup completed!
-----------------------------------------------------------------------
4. 测试文件上传
-----------------------------------------------------------------------
root@Pogo:/mnt/DropboxUl# ./dropbox_uploader.sh upload /media/pogo110/lsusb.
txt /public/lsusb.txt
> Uploading /media/pogo110/lsusb.txt to /public/lsusb.txt...
############################################################ 100.0%
> DONE
因为我在首次运行时设置上传的根目录是App folder而非Full Dropbox(安全起见),并
且我把App folder重命名为PogoPlug,所以我的例子里上传的文件是在:
Dropbox/Apps/PogoPlug/public/lsusb.txt
-----------------------------------------------------------------------
5. 批量上传
下面是我写的批量上传的bash script:startdpul.sh,我把它扔到/mnt目录下
####################################
#!/bin/bash
for file in /media/pogo110/*.txt;
do
/mnt/DropboxUl/dropbox_uploader.sh upload "${file}" /pub/$(basename "${file}
");
done;
#######################################
上述代码是把/media/pogo110/目录下的所有.txt文件上传到dropbox/Apps/PogoPlug/
下的pub目录下,以下是演示结果
-----------------------------------------------------------------------
root@Pogo:/# /mnt/startdpul.sh
> Uploading /media/pogo110/cpuinfo.txt to /pub/cpuinfo.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/fdisk.txt to /pub/fdisk.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/hdinfo.txt to /pub/hdinfo.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/hwinfo.txt to /pub/hwinfo.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/ipconfig.txt to /pub/ipconfig.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/kernel.txt to /pub/kernel.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/lsusb.txt to /pub/lsusb.txt...
############################################################ 100.0%
> DONE
> Uploading /media/pogo110/meminfo.txt to /pub/meminfo.txt...
############################################################ 100.0%
> DONE
-----------------------------------------------------------------------
你可以把文件夹下的所以文件都上传了,比如*.*。
俺还不会连子目录一起上传,请大侠指点。
6. 定时上传
这个需要写个cron script,比如
startdpul.cron:
30 20 * * * /mnt/startdpul.sh
这个是每天晚上8:30自动上传,更多cron的例子:
e.g.
01 * * * * root echo "This command is run at one min past every hour"
17 8 * * * root echo "This command is run daily at 8:17 am"
17 20 * * * root echo "This command is run daily at 8:17 pm"
00 4 * * 0 root echo "This command is run at 4 am every Sunday"
* 4 * * Sun root echo "So is this"
42 4 1 * * root echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * root echo "This command is run hourly on the 19th of July"
7. 自动检测文件更新上传,这个俺不会,请大侠指点
8. 参考文献:
Squeezebox server:
http://rustybytes.com/2011/02/16/setup-your-pogoplug-as-a-squeezebox-server/
Motion:
http://www.youtube.com/watch?v=rzrXJLdNHwM&feature=related
PogoWeather的例子,但没有具体的tutorial:
http://davysweather.dyndns.org/ | n*********n 发帖数: 5605 | 2 牛
snapshots
pro
【在 E**a 的大作中提到】 : 掌中宝外设,JR上19.99那个P21 black实际上是E02。 : 发信人: Exia (漂流瓶), 信区: Hardware : 标 题: PogoPlug安装Dropbox攻略(部分原创) : 发信站: BBS 未名空间站 (Sat Dec 1 06:05:21 2012, 美东) : 初衷:原本想用pogoplug架个surveillance webcam,然后把video stream和snapshots : 自动上传到dropbox(之所以用dropbox,是因为这个不需要安装客户端,其他的软件俺 : 暂时没找到解决方案). 用lsusb和hwinfo都能看到我的6年老的logitech quickcam pro : for notebook,但motion始终无法打开/dev/video0,用ls /dev/video*查看竟然无 : video device,真tm奇怪。 : 下面姑且把dropbox搞定:
|
|