#!/usr/bin/env perl use strict; use warnings; use 5.010; =pod =head1 DESCRIPTION This script is used for taking and deleting a single snapshot. Snapshot names look something like this: 'day=01_07_2021,time=15:30'. Exactly six arguments must be given: 1: subvolume to be snapshotted 2: root snapshot directory (typically /.snapshots) 3: the yabsm name of the subvolume being snapshotted (ex: 'root' for '/') 4: the timeframe for the snapshot (hourly, daily, etc). 5: the desired date format. Either 'mm/dd/yyyy' or 'dd/mm/yyyy' 6: the number of snapshots the user wants to keep for this subvolume/timeframe. This script should not be used by the end user. =cut #################################### # GRAB INPUT PARAMETERS # #################################### my $subvol_to_snapshot_arg = $ARGV[0]; my $snap_root_dir_arg = $ARGV[1]; my $yabsm_subvol_name_arg = $ARGV[2]; my $timeframe_arg = $ARGV[3]; my $date_format_arg = $ARGV[4]; my $snaps_to_keep_arg = $ARGV[5]; #################################### # MAIN # #################################### delete_earliest_snapshot(); take_new_snapshot();