diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-12 18:47:46 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-12 18:47:46 -0500 |
commit | 1f96ce1e0c64aec0458e1c2e374cd627d7a89931 (patch) | |
tree | ec37793420a65715db5ed5ea4170093667863fd8 | |
parent | 55fc9fa32e797a77daa8e5e87fcea6d0b2b27983 (diff) | |
download | squashfu-1f96ce1e0c64aec0458e1c2e374cd627d7a89931.tar.gz |
Add usage function and mount checking (and unmounting) in rollback function
-rwxr-xr-x | squashfu | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -230,6 +230,34 @@ create_new_incremental () { return $? } +usage () { + info "SquashFu: a backup solution hewn out of boredom" + cat <<HELP + +USAGE + squashfu <operation> [options] + +OPERATIONS + -B + Runs a regular backup, using the config file at /etc/squashfu, unless + otherwise specified with the -c option. + + -Q + Displays the size of the seed, the incrementals, and the actual backup. If + you provide no additional options, a basic report will be given. Specifying + "full" will give more detail about individual bins. + + -R <number of bins> + Rollback specified number of backups and mount union for browsing. The rolled + back data will be mounted at $UNION_MOUNT. + + -U + Unmount squash and union. Although SquashFu will always check and unmount as + necessary before an operation, this is provided as a safeguard. +HELP + exit 0 +} + action_backup () { # Args: options array squashfu was invoked with, shifted 1 # Returns: none @@ -291,6 +319,8 @@ action_rollback () { local num_to_mount=$[ ${#bin_list[@]} - $1 ] + mountpoint "$UNION_MOUNT" || mountpoint "$SQUASH_MOUNT" && unmount_all + mount_squash mount_union_with_bins ${bin_list[@]:(-$num_to_mount)} |