Snapshots

Posted by tonvoon on 19 November 2009 - 9:28pm

Snapshot Process

Snapshots are run on nagiosplugins.org by the nagiosplugins user via cron every hour.

This executes the bin/sfsnapshot-upload script which uses a git repo in ~/staging. If there have been changes, then it uploads to SF.

The upload to SF uses the SSH key pair for the nagiosplugins user. The public key is associated with Ton's SF account, so don't misuse it!

The master sfsnapshot-upload and associated sfsnapshotgit are held in git under tools/.

Adding a branch

These steps are UNESTED for now...

Adding the branch "nagiosplug-branch" to the snapshots (the branch must already be in the official Git repository):

  1. From the ~/staging/nagiosplugins repository, checkout and create the local tracking branch

    $ git checkout origin/nagiosplug-branch
    $ git checkout -b nagiosplug-branch

  2. Add the branch to the cronjob arguments. i.e. change this:

    0 * * * * /home/nagiosplugins/bin/sfsnapshot-upload master 2>/home/nagiosplugins/sfsnapshot-upload.log || cat /home/nagiosplugins/sfsnapshot-upload.log 1>&2

    To this:

    0 * * * * /home/nagiosplugins/bin/sfsnapshot-upload master nagiosplug-branch 2>/home/nagiosplugins/sfsnapshot-upload.log || cat /home/nagiosplugins/sfsnapshot-upload.log 1>&2

  3. On the next run, verify the log (~/sfsnapshot-upload.log)

Removing a branch

These steps are UNESTED for now...

Removing the branch "nagiosplug-branch" from the snapshots:

  1. Remove the branch to the cronjob arguments. i.e. change this:

    0 * * * * /home/nagiosplugins/bin/sfsnapshot-upload master nagiosplug-branch 2>/home/nagiosplugins/sfsnapshot-upload.log || cat /home/nagiosplugins/sfsnapshot-upload.log 1>&2

    To this:

    0 * * * * /home/nagiosplugins/bin/sfsnapshot-upload master 2>/home/nagiosplugins/sfsnapshot-upload.log || cat /home/nagiosplugins/sfsnapshot-upload.log 1>&2

  2. From the ~/staging/nagiosplugins repository, remove the local tracking branch

    $ git branch -D nagiosplug-branch

  3. On the next run, verify the log (~/sfsnapshot-upload.log)
  4. Verify that next run actually remove all related files and erase this line.