Announcement

Collapse
No announcement yet.

Snapper 0.2.6-0

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Snapper 0.2.6-0

    A while back I experimented with the version of Snapper (0.1.8-2) that is in the repository. It had some problems which I've mentioned in other posts. For the last few days I've been playing with Snapper 0.2.6-0, which fixes bugs and gives improvements over the version in our repository. I obtained the .deb packages from here except that I didn't download or install the snapper-zypp-plugin package.

    I wrote a script to create a set of PRE or POST snapshots in root and home that have the same timestamp. The user would run the script using "PRE" before any proposed shanges, make the changes, and then run the script using "POST" after the changes. If the changes aren't what the user wanted they can run snapper undochange n..m where n and m are the PRE and POST numbers, then deletes both the pre and post snapshots to complete the cleanup. If the user likes the changes then just delete both the pre and post snapshots in both root and home. No use wasting disk space on unneeded snapshots. If undochange was used then it would be a good idea to reboot so the kernel can learn what you are up to.

    Here is the source for my script.
    Code:
    #!/bin/bash
    # created by Jerry L Kreps on July 20, 2015 and released under the GPL 2.0.
    # This script merely creates a snapshot in both root and home with the designation of PRE or POST as the type, 
    # which indicates that the user created it before an action or afterwards.
    # This script is run with PRE as the TYPE before an action which you may want to reverse
    # AND this script run again with POST as the TYPE after that action has been completed.  Both snapshots are singletons because
    # no timeline is used.  Only the "PRE" or"POST" in the description, along with a timestamp, links the pre to the post snapshot.
    # To reverse the action run the following two snapper commands:
    #
    # [B]snapper -c home udochange n..m[/B]   where n or o is the number of the PRE and m or p is the number of the POST snapshot
    # [B]sudo snapper -c root undochange o..p[/B]
    #
    # After running those two commands both of the empty snapshots folders can be deleted using
    #
    #[B] snapper -c home delete n-m[/B]
    #[B] sudo snapper -c root delete o-p[/B]
    #
    #
    NOW=$(date +%Y%m%d%H%M)
    echo Enter snapshot type PRE or POST:
    read TYPE
    echo Enter description
    read DESC
    STR=$TYPE" "$DESC" "$NOW
    HCMD='snapper -c home create -d "'${STR}'"'
    RCMD='sudo snapper -c root create -d "'${STR}'"'
    eval "$HCMD"
    eval "$RCMD"
    echo $STR
    Future plans include adding the muon command to include installing one or more packages between the two snapper commands.
    Last edited by GreyGeek; Jul 20, 2015, 02:02 PM.
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.
Working...
X