Raspberry Pi Study Notes (7): using Bypy to achieve Raspberry Pi nas sync Baidu Cloud

Source: Internet
Author: User

Reprint please specify: @ Xiao Wu Yi Http://www.cnblogs.com/xiaowuyi qq Group: 64770604

The Raspberry Pi production NAS process is described in http://www.cnblogs.com/xiaowuyi/p/4051238.html.

Bypy is a Baidu cloud/Baidu network Disk Python client, the main purpose is in the Linux Environment (command line) sync Baidu Cloud disk space. Bypy requires more than python2.7 version, the latest version is Https://github.com/houtianze/bypy

First, Bypy installation

1, the required environment

Python 2.7x

Python requests library (Setuptools and PIP are required to install the library)

2. Installation

(1) Python 2.7 is not in detail

(2) Requests Library installation

Install Setuptools First

wget https://bootstrap.pypa.io/ez_setup.py -O - | python

If there is a problem during installation, there may be no reason to install zip decompression, zip how to install please Baidu.

Then install PIP

Https://pypi.python.org/pypi/pip Download pip-1.5.6.tar.gz from here

TAR-ZXVF pip-1.5.6.tar.gz

Python setup.py Install

After the installation is complete, PIP installs requests. Implementation of requests installation.

(3) Installation Bypy

Download the extract directly from the https://github.com/houtianze/bypy.

3. Use

(1) First time use

To set the system's region encoding to UTF-8

Change the original content to:

Lang= "ZH_CN. UTF-8 "

Set token:

./bypy.py Info

The program will ask you to visit a URL, get your authorization code, after authorization to copy code to the program, the program will use different servers for certification, the success of the certification will show Baidu Network disk capacity, if not successful, you can try several times, easy to be wall.

At this time Baidu network disk "My Application Management" will form Bypy file +.

After the installation is complete, you can use the./bypy.py list to see the following list.

(2) Main command parameters

Optional arguments:
-H,--help show this help message and exit
--testrun Perform python doctest [Default:false]
--profile profile The code [Default:false]
-V,--version show program ' s version number and exit
-D,--debug enable debugging & Logging [default:0]
-V,--verbose set verbosity level [default:0]
-R RETRY,--retry RETRY
Number of retry attempts on network error [Default:5
-Q quit,--quit-when-fail quit
Quit when maximum number of retry failed [default:
-t timeout,--timeout timeout
Network timeout in seconds [default:60]
-S SLICE,--slice SLICE
Size of File upload slice (can use ' 1024x768 ', ' 2k ',
' 3MB ', etc) [default:20 MB]
--chunk chunk size of File download chunk (can use ' 1024x768 ', ' 2k ',
' 3MB ', etc) [default:20 MB]
-E,--verify verify Upload/download [Default:false]
-F,--force-hash force file MD5/CRC32 calculation instead of using
cached values [Default:false]
-L ListFile,--list-file listfile
Input list file (used by some of the commands only
--resume-download Resumedl
Resume instead of restarting when downloading if local
File already exists [Default:true]
--include-regex Incregex
Regular expression of files to include. If not
Specified (default), everything is included. For
Download, the regex applies to the remote files; For
Upload, the regex applies to the local files. To
Exclude files, think about your regex, some tips here:
--on-dup Ondup What does when the same file/folder exists in the
Destination: ' Overwrite ', ' skip ', ' Prompt ' [default:
--no-symlink DON ' T follow symbol links when uploading/syncing up
--disable-ssl-check DON ' T verify host SSL cerificate [Default:true]
-C,--clean 1:clean settings (remove the token file) 2:clean
Settings and hash cache [default:0]

Help Command-provide some information for the command
Cleancache-remove invalid entries from hash cache file
Combine <remotefile> [md5s] [LocalFile]-try to create a file at PCS by combining slices, have md5s specified
Compare [Remotedir] [Localdir]-Compare the remote direcotry with the local directory
COPY/CP <from> <to>-Copy a file/dir remotely at Baidu Yun
Delete/remove/rm <remotepath>-Delete a file/dir remotely at Baidu Yun
Downdir <remotedir> [Localdir]-Download a remote directory (recursively)
Downfile <remotefile> [LocalPath]-Download a remote file.
Dumpcache-display File Hash Cache
List/ls [RemotePath] [format] [sort] [order]-list the ' RemotePath ' directory at Baidu PCS
listrecycle [start] [limit]-List the recycle contents
Meta <remotepath> [format]-Get information of the given path (dir/file) at Baidu Yun.
mkdir <remotedir>-Create a directory at Baidu Yun
Move/mv/rename/ren <from> <to>-Move a file/dir remotely at Baidu Yun
Quota/info-displays the Quota information
Refreshtoken-refresh the access token
Restore <remotepath>-Restore a file from the Recycle Bin
Search <keyword> [RemotePath] [recursive]-search for a file using keyword at Baidu Yun
Stream <remotefile> <localpipe> [format] [chunk]-stream a Video/audio file converted to M3U format at Clou D side, to a pipe.
Syncdown [Remotedir] [Localdir] [deletelocal]-sync down from the remote Direcotry to the local directory
Syncup [Localdir] [Remotedir] [deleteremote]-sync up from the local direcotry to the remote directory
upload [LocalPath] [RemotePath] [ondup]-Upload a file or directory (recursively)

Raspberry Pi Study Notes (7): using Bypy to achieve Raspberry Pi nas sync Baidu Cloud

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.