OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi Interval – Data Backup and Restore

This topic contains 3 replies, has 0 voices, and was last updated by  Dan in CA 6 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22546

    dennyfmn
    Participant

    I put together a little script that will backup and restore the contents of the …/OSpi/data directory. This is necessary if you want to preserve your local settings when you update to a new version from GitHub. There have been two updates in the last couple of days, which is great!

    I hope others will find it useful.


    #!/bin/bash

    # Backup or restore the OSPi data files - D. Fox - 7/22/2013
    # Adjust SRCDIR and BACKUPDIR as required

    # Suggested installation:
    # copy this script to /usr/local/bin/backup-ospi-data.sh
    # cd /usr/local/bin
    # ln -s backup-ospi-data.sh restore-ospi-data.sh

    SRCDIR="/usr/local/OSPi/data"
    BACKUPDIR="/usr/local/etc/OSPi/data"

    # create the backup directory (with parents) if necessary
    if [ ! -d $BACKUPDIR ];then
    mkdir --parents $BACKUPDIR
    fi

    # restore the data if invoked with restore-ospi-data.sh
    if [ `basename $0` == "restore-ospi-data.sh" ]; then
    cp -a $BACKUPDIR/* $SRCDIR/
    exit 0
    fi

    # backup the data if invoked with backup-ospi-data.sh
    cp -a $SRCDIR/* $BACKUPDIR/
    exit 0

    #24899

    Samer
    Keymaster

    Just to add another option. If you use my mobile app you will notice the side panel has an export/import config. You can export the config, upgrade OSPi, and import the config back.

    Of course it’s helpful to know what my app backs up which is: programs, station names, master operation bits (which stations use a master station) and all device options.

    #24900

    craigmw
    Participant

    Samer:

    Is there any way to implement updates for Dan’s interval program from your web app? This would make the process of keeping OSPi updated much easier. Thanks again for your excellent work!

    #24901

    Samer
    Keymaster

    I actually think it should be possible using Github since Ray has kept the OSPi extracted folder. I will play with it some and see what I can do.

    #24902

    Dan in CA
    Participant

    Keep in mind that with some updates it is only necessary to replace the ospi.py Python file and it is not necessary to backup and restore the config files.
    In other updates there have been changes to various other files and it is best to do a full re-install. This will likely be the case when the parallel/sequential option is added.

    I just discovered that it is easy to auto detect the Pi board rev and have implemented code to set the GPIO pin configuration automatically. This eliminates the need to manually edit the code tor use with Rev 1 boards.

    Dan

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) OSPi Interval – Data Backup and Restore