Random Ramblings on LabVIEW Design

Community Browser
Labels
cancel
Showing results for 
Search instead for 
Did you mean: 

Recovery Part 2 of 3 Local Backups

swatts
Active Participant

Hello my lovelies,

Hope you are all safely back from NIWeek, vacations etc.

I'm most interested in the new cDAQ and cRIO platforms they look a real advance.

I'm all back and running again now and implemented some pretty nice stuff on my VPS (I still have a lot to learn here so fair warning). The VPS Subversion repositories are working lovely and I've even used post-commit triggers to send emails of any commit action, this is very cool and I didn't know Subversion even had this capability.

Popular advice is store your backups in the cloud, bitter experience has shown that actually the reverse is also vital. So this article discusses getting your stuff back from the server.

First things first lets look at repositories. We store a repository in a directory /usr/local/svn/repos/CompanyName-RepoName (for example our documentation will be stored in /usr/local/svn/repos/SSDC-CompanyDocs)

We want to list the directory /usr/local/svn/repos and pull out a list of Repos, we then want to zip them up and post them to a directory accessible by FTP

svnadmin dump /usr/local/svn/repos/REPONAME | gzip > /home/ftp/REPONAME.gz

The above Linux command will dump the repository at /usr/local/svn/repos/REPONAME and pipe it to a gzip file REPONAME.gz. Here I sacrificed speed for UI feedback by doing each file individually and then ftp'ing it out.

BackupDialog.png

IMPORTANT NOTE: Remember to password your VIs to protect your important login information!!!!!

I had to doctor the standard LabVIEW FTP VIs to give me some real-time feedback of transferred data. This involved copying \National Instruments\LabVIEW 2013\vi.lib\FTP over to my project and making a LVLIB to hold it. I add some Local Globals (my facetious name for a privately scoped global variable) to get the data going through TCP/IP.

TCP Read Stream.png

I also added a publicly scoped VI to allow me to read the global data. Now I have a nice progress bar control updating with transferred data.

BackupDialogCode.png

Noticed that I changed the colour of the FTP Get Multiple Files.vi, this is a mental clue that I have changed a standard LabVIEW VI.

I also dump my shared databases using the similar Linux command. The process after that is exactly the same.

mysqldump --user=******* --password=******* dbName | gzip > /home/ftp/dbName.gz

If you want any details, leave a comment and I'll fill in the gaps. If you want any code I'm sure we can sort something out, especially if you're not a local competitor .

Next week will be the last in this series and I'll be looking at bug reporting.

Lots of Love

Steve

I saved you time generating a mission statement in a previous article, now I'm going to save you time if you fancy writing an episode of Murder She Wrote.

MurderSheWrote.jpg

Click on Jessica to see more.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

Comments