Graph-IT

cron_btrfs_scrub.php

This script allows to run 'btrfs scrub' for one or multiple UUIDs and check whether the last 'btrfs scrub'-call produced any errors.

Usage:

cron_btrfs_scrub.php [uuid1] [uuid2] .. <start|status>

Parameters:

Note: In case no UUIDs are listed, 'btrfs scrub' will be called for the first mount point of each existing UUID.

Example:

cron_btrfs_scrub.php start

Calls "btrfs scrub", for the first mount point of each btrfs file system.',

cron_btrfs_scrub.php status

Checks whether the btrfs status of the first mount point belonging to a listed UUID shows any errors.

Side note: We usually call the script twice a day.

# Smart Checks
# btrfs check - jeden Donnerstag
30 0 * * 4 <path to cron_btrfs_scrub.php> start
0  1 * * 4 <path to cron_btrfs_scrub.php> status

The first call starts 'btrfs scrub'' for all btrfs file systems. The second call checks whether any errors were found.