gboudreau/Greyhole

View on GitHub
greyhole.example.conf

Summary

Maintainability
Test Coverage
# This file is part of Greyhole.

#### Database Connection ####
# Only MySQL (or compatible) is supported.

    db_host = localhost
    db_user = greyhole_user
    db_pass = 89y63jdwe
    db_name = greyhole

#### Timezone ####
# You can comment this out if you already define a `date.timezone` in your php.ini. Otherwise, this config option is mandatory.
# See the list of allowed values here: http://www.php.net/manual/en/timezones.php

    #timezone = America/Montreal

#### Email Recipient ####
# Will receive email reports for daily fsck, or when all drives are out of 
# available space.
# When specifying no @hostname, the email will be delivered to the local 
# mailbox of that user.
# Make sure you have a MTA installed (sendmail, postfix, ...), or no emails will be sent!

    email_to = root
    #email_to = root@test.com

#### Greyhole Daemon Niceness ####
# Niceness of the background daemon that handle most of the heavy lifting.
# Number between -20 and 19.
# The higher the number, the more 'nice' the daemon will be, i.e. the less
# resources it will get, versus other processes with a lower niceness.

#    daemon_niceness = 1

#### Greyhole Log File ####
# If you define a greyhole_error_log_file, WARNING, ERROR and CRITICAL logs will be written there, instead of using greyhole_log_file.
# Notes:
#   - greyhole_error_log_file will be ignored if greyhole_log_file = syslog.
#   - you can't use syslog for greyhole_error_log_file and a normal file for greyhole_log_file.
#   - if you use something else than /var/log/greyhole.*, you will want to change /etc/logrotate.d/greyhole accordingly.

#    greyhole_log_file = syslog
    greyhole_log_file = /var/log/greyhole.log
#    greyhole_error_log_file = /var/log/greyhole.err

# Available verbosity levels: DEBUG, INFO, WARN, ERROR

    log_level = DEBUG

# Log Greyhole memory usage on each log line?

    log_memory_usage = no

# Look for other processes working on files on the Greyhole shares?
# Disable to get more speed, but this might break some files, if any 
# application change your files while Greyhole tries to work on them.

    check_for_open_files = yes

#### Copying ####
# Options for the command that will create file copies

# Calculate MD5 of new/changed files, while making file copies.
#    calculate_md5 = yes

# Create all file copies simultaneously, instead of sequentially.
#    parallel_copying = yes

#### Shares Settings ####
# Number of copies of each file you want Greyhole to keep, per Share.
# This is not the number of duplicates! 2 copies = 1 duplicate
# If you change one of those, you should run fsck manually, or wait for the 
# daily fsck, to have the additional copies created, or extra copies deleted.
#
# Example:
#
#    num_copies[Backups] = 2
#    num_copies[CrashPlan] = 2
#    num_copies[Games] = 2
#    num_copies[Music] = 2
#   # This will insure those files are on all HDD:
#    num_copies[Photos] = max
#    num_copies[RecordedTV] = 1
#    num_copies[Software] = 2
#    num_copies[TimeMachine] = 1
#    num_copies[Videos] = 2

#### Storage Pool ####
# Where should the file copies be kept?
# You probably want to list all your physical hard drives here.
# Also specify how much free space you want to reserve on each drive. This is 
# a soft limit that will be ignored if the necessary hard drives are below 
# their minimum.
# For example, if you specify a 100 GB limit on all drives, and only one still 
# have more than 100 GB of free space, and you save a new file on a share for 
# which you specified you want multiple copies, this drive will be used first, 
# but the other drives that have less free space will be used to store the 
# additional copies.
#
# Example:
#
#    storage_pool_drive = /mnt/hdd0/gh, min_free: 10gb
#    storage_pool_drive = /mnt/hdd1/gh, min_free: 10gb
#    storage_pool_drive = /mnt/hdd2/gh, min_free: 10gb
#    storage_pool_drive = /mnt/hdd3/gh, min_free: 10gb

# If you'd like you drives to sleep when inactive, setting a schedule here will
# prevent the Greyhole daemon from keeping your drives awake by checking them every 10s.
# Specify the time(s) when Greyhole is allowed to check storage pool drives.
# Supported format: *:mi (i.e. once per hour) and hh:mi (once per day)

    check_storage_pool_schedule = *:00

# The following can help you test Greyhole by defining multiple storage_pool_drive 
# that are in fact just empty directories on the same drive.
# WARNING! Do NOT enable that option when you're not testing Greyhole.
# Doing so could result is lost data when a drive will fail.
#
#    allow_multiple_sp_per_device = no

### Storage Drive Selection Groups ###
# The groups you define here will be available to use in the 
# drive_selection_algorithm option(s) below.
# The group names (OK, NEW, BROKEN, REMOTE in the example below) can be 
# anything you'd like, and are case-sensitive.
# Use one line per group, with the following syntax:
#   group name: zero or more (comma-separated) storage pool drives
# If you ommit any storage pool drive from your groups, this drive 
# will NOT be used by Greyhole!
#
# See https://github.com/gboudreau/Greyhole/wiki/SuggestedStorageSelectionAlgorithmUsage
#   on how we suggest you use this feature.

#    drive_selection_groups = OK: /mnt/hdd0/gh, /mnt/hdd2/gh
#    drive_selection_groups = NEW: /mnt/hdd1/gh
#    drive_selection_groups = BROKEN: /mnt/hdd3/gh
#    drive_selection_groups = REMOTE: /mnt/remote1/gh

# You can also define drive_selection_groups for specific shares:
#
#    drive_selection_groups[Photos] = SATA: /mnt/hdd0/gh
#    drive_selection_groups[Photos] = IDE: /mnt/hdd1/gh, /mnt/hdd2/gh
#    drive_selection_groups[Photos] = USB: /mnt/hdd3/gh

#### Storage Drive Selection Algorithm ####
# available algorithms: most_available_space, least_used_space
#   most_available_space: use the drives with the most available space 
#     first, so that available space on all drives should become and stay 
#     balanced.
#   least_used_space: use the drives with the least used space 
#     first, so that used space on all drives should become and stay 
#     balanced.

    drive_selection_algorithm = most_available_space

# If you defined drive_selection_groups above, you'll want to use them here.
# Use the 'forced' keyword, then list the groups you want to use, in order, and 
# prefix each group name with the number of drives you want to use from 
# that group before using the next group.
# Use the 'all' keyword to indicate you want Greyhole to use all drives 
# from a specific group before starting to use drives from the next group.
# You'll need to indicate how Greyhole should pick drives within a group by 
# ending your line with either 'least_used_space' or 'most_available_space'.
#
#    drive_selection_algorithm = forced (1xOK, 1xNEW, 1xBROKEN, 1xREMOTE) most_available_space

# You can also define drive_selection_algorithm for specific shares:
#
#    drive_selection_algorithm[Videos] = least_used_space
#    drive_selection_algorithm[Photos] = forced (all SATA, 1xIDE, 1xUSB) most_available_space

#### Sticky Files ####
# Sticky files are files that will always 'live' together, in the storage pool.
#
# This will allow you to read (and read-only!) those files by using the 
# storage pool drives themselves, instead of using the mounted shares.
# To see when that might be useful, read Issue #3 at the URL below.
# [http://code.google.com/p/greyhole/issues/detail?id=3]
#
# Each sticky_files line should start with the name of a share, followed by a 
# directory inside that share.
# One or more stick_into lines should follow each sticky_files line, if you 
# want the files to go on specific hard drive(s).
# If you don't specify any stick_into, the drive with the most free space will 
# be use to hold your files together.
#
#    sticky_files = Music/
#
#    sticky_files = Videos/Movies/
#        stick_into = /mnt/hdd1/gh
#        stick_into = /mnt/hdd5/gh

# How long should free space calculations be cached (in seconds).
# When selecting drives using their available / free space, the last cached 
# value will be used.
# Use 0 to disable caching.

    df_cache_time = 15

#### Trash ####
# The Trash (also called Attic or Recycle Bin), is used as a safeguard against 
# human or machine errors.
# Greyhole can use the Trash for files that have been deleted and/or modified.
# It is strongly recommended that you keep both settings ON; this will further 
# protect your files.
# You can specify per-share preferences that will override the global 
# preference.

    delete_moves_to_trash = yes
#    delete_moves_to_trash[RecordedTV] = no

    modified_moves_to_trash = yes
#    modified_moves_to_trash[RecordedTV] = no

#### Frozen directories ####
# Directories listed below will not be touched by Greyhole until the user 
# wants it to (greyhole --thaw=<dir>).
#
# This can be used to process often-updated files at regular intervals, 
# instead of having Greyhole process them as soon as they change.
#
# Each frozen_directory line should start with the name of a share, followed 
# by a directory inside that share.

#    frozen_directory = Data/mysql

#### Maximum Queued Tasks ####
# Maximum number of queued tasks to store in MySQL, when parsing the
# spool directory. Use a lower number if you experience slowness while parsing 
# spooled operations.
# Default is 10000000.
# Setting a value here will overwrite those defaults.

#    max_queued_tasks = 10000000

#### Memory Limit ###
# Maximum amount of memory that Greyhole can consume while running.
# This can be higher than the global php.ini memory limit.
# If greyhole uses >95% of available memory while loading
# data, it will quit and throw an error in the logs.
# Default is 512M
# Setting a value here will overwrite this default.
# It is NOT advisable to lower the memory limit.
#    memory_limit = 512M

#### Executed tasks retention ####
# How long should executed tasks be kept in the database, after having been executed.
# Those are strictly for debugging purposes; they serve no other purposes.
# Enter a number of days, or 'forever' (no quotes).
# The default is to keep 60 days.

#    executed_tasks_retention = 60

#### Ignored files & folders ####
# Files that match the patterns below will be ignored by Greyhole.
# They will stay in the landing zone indefinitely, so be careful on what you 
# define here. List here all files and folders that are temporary, to prevent
# Greyhole from working for nothing.
#
# Format is Regular Expressions (PCRE syntax)
#
# ignored_files is matched against the file name only.
# ignored_folders is matched against the concatenation of the share name and
#   the full path to the file (without the filename), eg: Videos/Movies/HD/

    # rsync temporary files
    ignored_files = \..*\.[0-9a-zA-Z]{6}
    # Microsoft Office temporary files
    ignored_files = [0-9A-F]{8}\.tmp
    # CrashPlan (restore) temporary files
    ignored_files = \.cprestoretmp.*
    # SABnzbd temporary folders when extracting a download
    ignored_folders = .*/_UNPACK_.*
    # NZBget temporary folders when extracting a download
    ignored_folders = .*/_unpack.*
    # Plex Optimized Versions temporary files
    ignored_folders = .*/inProgress/.*
    # Mac metadata files
    ignored_files = \.DS_Store
    # Windows thumbs database files
    #ignored_files = Thumb.db

#### Hooks ####
# Call custom scripts on events.
#
# Available events type: create, edit, rename, delete, mkdir, rmdir, warning, error, critical, fsck, idle, not_idle, email
# - For create, edit, rename, delete, mkdir, and rmdir: the hooks are called after Greyhole finished processing the operation;
# - for warning, error, critical and fsck: the hooks are called after Greyhole created a log;
# - for idle and not_idle: the hooks are called just before the daemon will sleep, or when it's about to start working again.
# - for email: the hook is called after Greyhole sent an email;
#
# The parameters sent to the custom scripts are:
#   - event_type (one of the above)
# If event is related to a file/folder on a share (create, edit, rename, delete, mkdir and rmdir), other params will be:
#   - share_name
#   - path_on_share
#   - original_path_on_share (only for rename)
# If event is related to a log (warning, error, critical, fsck, idle and not_idle), other params will be:
#   - event_code: one of the predefined values that define the actual error/event.
#     Look here for the list of possible codes: https://github.com/gboudreau/Greyhole/blob/master/includes/Log.php#L62
#   - log: user-readable log (might contain LF characters)
# For email event, two parameters are sent: subject and body.
#
#    hook[create|edit|rename|delete|mkdir|rmdir] = /usr/share/greyhole/scripts-examples/greyhole_file_changed.sh
#    hook[warning|error|critical] = /usr/share/greyhole/scripts-examples/greyhole_notify_error.sh
#    hook[fsck] = /usr/share/greyhole/scripts-examples/greyhole_send_fsck_report.sh
#    hook[email] = /usr/share/greyhole/scripts-examples/greyhole_sysadmin_notification.sh
#    hook[idle|not_idle] = /usr/share/greyhole/scripts-examples/greyhole_idle.sh