opening

Regular reports of my grabber activity and that of others, plus information on QRSS software, hardware and technique that comes my way
Showing posts with label uploading. Show all posts
Showing posts with label uploading. Show all posts

Thursday, June 14, 2012

Archiving QRSS Uploads with Dropbox

One of the more difficult parts of operating a grabber is making an online archive and keeping it purged of old files.  I like to keep 24 hours of grabs which should give everybody time to look for their signal while they were asleep or whatever.

Until recently I had been using Picasa for archiving my grabber files using the feature which uploads images from my SL folder to Picasa Web and keeps the two synced.  As files in the SL folder get automatically deleted by a program called Autodelete when they are over 24 hours old the sync feature deletes the same files in the Picasa Web folder.  As Google made changes to Picasa the syncing process stopped working  requiring me to delete old files manually every day....ugh!  So now I use Dropbox.

I've seen Dropbox mentioned favorably as a place to store images and files for others to view so decided to check it out.  They offer a free account of 2 GB which is much more than adequate for my QRSS archiving. The files at Dropbox are maintained in sync with the corresponding folder on your computer. After establishing an account I linked it to my SL folder and then changed the URL link in my html file at qsl.net to that of the Dropbox folder...easy as pie and works like a charm.  I also like the images better and the ease of scanning through them.  The syncing is spot on.

The Dropbox account provides two folders, one for images and one for files.  Within the image folder you can add other folders and I use two, one for the 10 minute grabs and one for the 6 hour grabs.  The other folder for files has come in handy also as a way to include files with the posts in this blog ...Google doesn't allow files attachment in their blogs.

Autodelete is a neat little program that deletes computer files older than x days in specified folders when run, where x is 1 day or greater.  I run it 4 times a day automatically via the Windows Task Scheduler.  If you haven't used TS it is in Assesories/System Tools menu.

For a week now the Dropbox/Autodelete process has been performing flawlessly leaving me with one more thing I don't have to forget to do.

A special thanks to Dave, N4FRE, for watching the archives for problems, of which there were a few.

de w4hbk

Monday, June 4, 2012

Uploading Files Using DOS Commands

                             
Several months ago I found a somewhat hidden feature in Spectrum Lab which uses DOS commands in a simple batch file to directly upload grabs. I learned to use DOS commands and batch files years ago before there was Windows and the Internet so that's probably why I wasn't aware of the ftp DOS commands.  I haven't seen anyone describe it for QRSS grabbers so I'll report my experiences with it.

The programming consists of a few lines of code within SL and a few lines in a special file in the root directory,C:\.  Once it's working there's no need for a separate program such as Argo Uploader and it starts working as soon as SL is switched on.

Here's the two lines that go in the Periodic Actions page in SL:
-------------------------------------------
capture("C:\\ftp_upload\\SL1.jpg")
exec ("c:\\ftp_upload\\ftp_up.bat SL1.jpg")
-------------------------------------------
The first line makes the grab and stores it in the special folder in the root directory and the second line causes the batch file with the upload instructions to be executed and upload the file to my page at qsl.net.

The batch file and associated files are located in the folder c:\ftp_upload which contains the following files:

ftp_up.bat
ftpcmd.txt
ftplog.txt
SL1.jpg

Here's what the batch file, ftp_up.bat, looks like:
----------------------------------------
cd \ftp_upload

>> ftpcmd.txt echo USER user password

>> ftpcmd.txt echo binary

>> ftpcmd.txt echo put SL1.jpg

>> ftpcmd.txt echo disconnect

>> ftpcmd.txt ECHO bye

FTP  -n -s:ftpcmd.txt ftp.qsl.net > ftplog.txt

End
---------------------------------------

The files ftpcmd.txt and ftplog.txt are generated the first time the batch file runs so you don't have to worry about their content. SL1.jpg is the name of the grabbed image file that is expected by my page at qsl.net.  For the longer grabber it's 4Hr.jpg.

The first line in ftp_up.bat ensures we're in the directory with the file to be uploaded.  The other lines are standard DOS commands and the only thing you need to change is user and password in the next line and the ftp address of you web page in the next to last line.  Note that the USER in caps is part of the DOS ftp command and user is your username at your web site.  Otherwise it's not necessary to understand DOS command programming (which I barely do).

I actually have three versions of the batch uploader, one for each of my two grabbers and one to upload an "Off the Air" screen.  I simply name them ftp_upload1, 2 and 3. It's very versatile.

The only drawback to this method of uploading is that a small black cmd: screen pops up for a few seconds while it's uploading. If you find it annoying there's a way to suppress this screen but I'll save that procedure for a ps below.

Here is my Periodic Action Screen in Spectrum Lab:

Spectrum Lab Periodic Action Screen
The first line captures the screen for my storage folder and gives it a name like "SL04JUN12 1410z".
The second line captures it again with the name "SL1" just for upload purposes.
The third line executes the upload batch file.

DOS commands and batch files can be pretty tricky because of all the parameters and switches so if you have trouble I'll be glad to help.

de w4hbk

ps  How to suppress the black pop-up cmd: screen.

There is a Properties Box associated with the cmd: screen which can be invoked by right clicking on the bar at the top of the cmd: screen.  Since it stays on for only a few seconds it will be necessary to hit the "Pause" key to make it freeze so you have time to work, then "any key" to resume.  This doesn't actually suppress it but it reduces the size and moves it to a corner.  Change "Window Size" to 1 for both width and height and "Window Position" to move it to a corner.  As you change the numbers you'll see the changes in the "Window Preview".  It can actually be moved completely off screen by making one of the position numbers larger than the screen but I left mine as a tiny screen at the lower left so I'll be aware something is happening.  Maybe as I get more confident I'll move it totally off.