OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › OSPi Interval – Data Backup and Restore
- This topic is empty.
-
AuthorPosts
-
July 22, 2013 at 4:55 pm #22546
dennyfmnParticipantI 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
July 22, 2013 at 6:08 pm #24899
SamerKeymasterJust 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.
July 23, 2013 at 5:09 am #24900
craigmwParticipantSamer:
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!
July 23, 2013 at 12:50 pm #24901
SamerKeymasterI 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.
July 23, 2013 at 3:11 pm #24902
Dan in CAParticipantKeep 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
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › OSPi Interval – Data Backup and Restore