Skip to content

Commit

Permalink
Added /sbin/btrfs to the list of checked binary locations (used on …
Browse files Browse the repository at this point in the history
…Gentoo)
  • Loading branch information
nazar-pc committed Mar 17, 2017
1 parent 176c6d2 commit a108705
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.9 (17 March, 2017)
* Added `/sbin/btrfs` to the list of checked binary locations (used on Gentoo)

# 0.8 (24 March, 2016)
* `minimum_delete_count` and `minimum_delete_count_other` options introduced

Expand Down
15 changes: 13 additions & 2 deletions just-backup-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<?php
namespace nazarpc;
use
RuntimeException,
SQLite3;

/**
* @package Just backup btrfs
* @author Nazar Mokrynskyi <[email protected]>
* @copyright Copyright (c) 2014-2017, Nazar Mokrynskyi
* @license http://opensource.org/licenses/MIT
* @version 0.7
* @version 0.9
*/
class Just_backup_btrfs {
/**
Expand All @@ -22,13 +23,23 @@ class Just_backup_btrfs {
protected $binary;
/**
* @param array $config
*
* @throws RuntimeException
*/
function __construct ($config) {
if (!$config) {
exit("Incorrect configuration, aborted\n");
}
$this->config = $config;
$this->binary = file_exists('/usr/sbin/btrfs') ? '/usr/sbin/btrfs' : '/bin/btrfs';
if (file_exists('/usr/sbin/btrfs')) {
$this->binary = '/usr/sbin/btrfs';
} elseif (file_exists('/sbin/btrfs')) {
$this->binary = '/sbin/btrfs';
} elseif (file_exists('/bin/btrfs')) {
$this->binary = '/bin/btrfs';
} else {
throw new RuntimeException("Can't find btrfs binary");
}
}
function backup () {
$default_config = [
Expand Down

0 comments on commit a108705

Please sign in to comment.