Skip to main content

Backup the folder to FTP!

Project description

FtpBackup provides a simple way to backup all things in your folder to FTP.

FtpBackup take thesettings in the config file (default is .ftpbackup). And you can add ignore files in .ftpignore and .gitignore.

Installation

pip install ftpbackup

Tested Platforms

  • Python:

  • 3.4-3.6

  • Windows (32bit/64bit):

  • Only test on win10 now.

Getting started

  1. Generate your config file

    ftpbk genconf
  2. Edit your config file.

  3. Add a new file called ‘.ftpignore’ and edit it.

  4. Backup your floder to FTP by the command.

    ftpbk backup

NOTE : Because .ftpbackup contains IP, password, and other pravite info. So it’s necessary to add it in .gitignore or .ftpignore manually. You can also add it in git global ignore file list.

Set the config file (default: .ftpconfig)

The default config is like below.

{
    "protocol": "ftp", // string - Only 'ftp' now.
    "host": "localhost", // string - The hostname or IP address of the FTP server. Default: 'localhost'
    "encoding": "utf-8", // string - The encoding of the FTP server. Default: utf-8
    "port": 21, // integer - The port of the FTP server. Default: 21
    "user": "anonymous", // string - Username for authentication. Default: 'anonymous'
    "pass": "anonymous@", // string - Password for authentication. Default: 'anonymous@'
    "remote": "/", // string - The path on FTP to upload files.
    // NOTE : Use absolute path of remote or get a error.
    "local": ".", // string - The folder on local to be uploaded.
    "useGitIgnore": true, // bool - Use .gitignore in ignored file list.
    "gitIgnoreEncoding": "utf-8", // string - The encoding of .gitignore
    "useFtpIgnore": true, // bool - Use .ftpignore in ignored file list.
    "ftpIgnoreEncoding": "utf-8" // string - The encoding of .ftpignore
}

Set the .ftpignore

The format of .ftpignore is just like .gitignore.

CLI

usage: ftpbk [-h] {genconf,backup} ...

Backup to FTP.

optional arguments:
  -h, --help        show this help message and exit

commands:
  {genconf,backup}

command ‘genconf’:

usage: ftpbk genconf [-h] [-F] [-f FILE]

Generate a default config file.

optional arguments:
  -h, --help            show this help message and exit
  -F, --force           overwrite the config file if it exists.
  -f FILE, --file FILE  assign the config file to be writed, default is
                        '.ftpbackup'.

command ‘backup’:

usage: ftpbk backup [-h] [-c CONFIGFILE]

Backup all the file in the 'local' floder to 'remote' on ftp. You can change
the config in config file(default is '.ftpbackup').

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIGFILE, --conf CONFIGFILE
                        assign the config file to be loaded, default is
                        '.ftpbackup'.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftpbackup-0.1.6.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file ftpbackup-0.1.6.tar.gz.

File metadata

  • Download URL: ftpbackup-0.1.6.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ftpbackup-0.1.6.tar.gz
Algorithm Hash digest
SHA256 14ec92defb06586f91ec114c5563ab0d0fdc9b60a58472ad4e26937fe6748594
MD5 177bae3a2037179a72175c205145d8ce
BLAKE2b-256 6528954fa21200de199cffc146fad69ade78e98e325e1feabc6250470090ff03

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page