Before running the script, you must copy the config file /opt/ftpgrab/ftpgrab.conf to /opt/ftpgrab/conf/seedbox.conf.
Here i have named the config file seedbox.conf. You can name it as you want but it must be unique!
The name of the config file (seedbox) will be used during the process to create the PID file, the logs files and the hash file so be careful with it!

General

DIR_DEST

  • required
  • default value /tmp/seedbox

Path where the files will be downloaded.
Example: DIR_DEST="/tmp/seedbox"

EMAIL_LOG

  • optional

Mail address where the logs are sent. Leave empty to disable sending mail.
Example: EMAIL_LOG="foo@foo.com"

DEBUG

  • required
  • default value 0

Enable debug.
Example: DEBUG=1

FTP

FTP_HOST

  • required

FTP host IP or domain.
Example: FTP_HOST="198.51.100.0" or FTP_HOST="ftp.foo.com"

FTP_PORT

  • required

FTP port.
Example: FTP_PORT=21

FTP_USER

  • required

FTP username.

FTP_PASSWORD

  • required

FTP password.

FTP_SOURCES

  • required

FTP sources paths to grab.

Example for one path:

FTP_SOURCES="/downloads/"

Example for multi paths:

FTP_SOURCES="\
  /downloads/;\
  /other_path/;\
  /yet_another_path/;\
"

FTP security

Works only with curl method

FTP_SECURE

  • required
  • default value 0

Open a secure FTP connection (SSL/TLS). Only available for curl method.
Example: FTP_SECURE=1

FTP_CHECK_CERT

  • required
  • default value 0

Check the server certificate against the available certificate authorities.
Not used if FTP_SECURE=0.
Example: FTP_CHECK_CERT=1

Download

DL_METHOD

  • required
  • default value wget

The download method. Can be wget or curl.
Example: DL_METHOD="wget"

DL_USER

  • optional

Linux owner user of downloaded files.
Example: DL_USER="ftpuser"

DL_GROUP

  • optional

Linux owner group of downloaded files.
Example: DL_GROUP="ftpgroup"

DL_CHMOD

  • optional

Permissions of downloaded files.
Example: DL_CHMOD="644"

DL_REGEX

  • optional

Apply a filter to search for files with a regular expression.
Separate each regular expression with a semicolon.
Leave empty to grab all files.

Example for one regex:

DL_REGEX="Game.Of.Thrones.*.avi"

Example for multi regex:

DL_REGEX="\
  Game.Of.Thrones.*.avi;\
  Burn.Notice.*.avi;\
  The.Big.Bang.Theory.*VOSTFR.*720p.*WEB-DL.*.mkv;\
"

DL_RETRY

  • required
  • default value 3

Number of retries in case of download failure.
Example: DL_RETRY=3

DL_RESUME

  • required
  • default value 0

Resume partially downloaded file.
Example: DL_RESUME=0

DL_SHUFFLE

  • required
  • default value 0

Shuffle file/folder listing (more info on (PR #25).
Example: DL_SHUFFLE=0

DL_HIDE_SKIPPED

  • required
  • default value 0

Not display the downloads already made or valid in logs.
Example: DL_HIDE_SKIPPED=0

DL_HIDE_PROGRESS

  • required
  • default value 1

Not display the progress dots during downloads.
Example: DL_HIDE_PROGRESS=1

DL_CREATE_BASEDIR

  • required
  • default value 0

Create basename of a ftp source path in the destination folder.
WARNING: Highly recommended if you have multiple ftp source paths to prevent overwriting!
Does not work if FTP_SOURCES="/".

Example if DL_CREATE_BASEDIR=1 and :

  • The destination folder is /tmp/seedbox
  • FTP_SOURCES="/downloads/;/other_path/"
  • /downloads/ src path contains a file called dl_file1
  • /other_path/ src path contains a file called other_file2


The destination structure will be :

[-] tmp
 | [-] seedbox
 |  | [-] downloads
 |  |     | dl_file1
 |  | [-] other_path
 |  |     | other_file2

Example if DL_CREATE_BASEDIR=0 and :

  • The destination folder is /tmp/seedbox
  • FTP_SOURCES="/downloads/;/other_path/"
  • /downloads/ src path contains a file called dl_file1
  • /other_path/ src path contains a file called other_file2


The destination structure will be :

[-] tmp
 | [-] seedbox
 |  |  | dl_file1
 |  |  | other_file2

Hash

HASH_ENABLED

  • required
  • default value 1

Enable audit file already downloaded.
Example: HASH_ENABLED=1

HASH_TYPE

  • required
  • default value md5

The hash type. Can be md5 or sha1.
For the sha1 method, your need to install the required package: apt-get install sha1sum.
Example: HASH_TYPE="md5"

HASH_STORAGE

  • required
  • default value text

The hash storage process. Can be text or sqlite3.
For the sqlite3 method, your need to install the required package: apt-get install sqlite3.
Example: HASH_STORAGE="text"