A while back I built a simple droplet app that took raw files and moved them from a desktop to a server location and did a DB update. I've now received a request from the photo dept. to have it also convert raw files to dng format.
The app is built in XCode but just runs an AppleScript. I've used shell scripts for updating databases and cURL and getting meta data. I don't want to and really can't pop open an app (like PS CS5) to do the conversion, is there a shell script out there that'll take care of this for me?
Related
I need to automate the upload of some files from client PCs to a central server. We're building central statistics for an online gaming community, processing game replay files.
target is my own small VPS server running ubuntu
upload file size 2-3MB
20-40 different clients running windows spread around the globe
I expect ~6GB of wanted data to be uploaded over the course of 7 weeks (a season in our game) and 5-10x that amount of "unwanted" data.
The files are processed on the server, and then they're not required anymore, and ought to be deleted to not run out of disk space eventually. I also only need some of the files, but due to the files requiring very complex processing including decryption, so i can only determine that after the server processed it.
My initial idea was to use a scriptable client such as WinSCP, and use some Windows scheduler entry to automate it. WinSCP documentation looks very nice. I am a bit hesitant because I see the following problems:
after deletion on the server, how to prevent re-upload ?
ease of setup to technical novices
reliability of the solution
I was thinking maybe someone has done the same before and can give some advice.
There's article on WinSCP site that deals with all this:
How do I transfer new/modified files only?
For advanced logic, like yours, it uses PowerShell script with use of WinSCP .NET assembly.
Particularly, there is a section that you will be interested in: Remembering the last timestamp – It shows how to remember the timestamp of the last uploaded file, so that the next time you will transfer only newer files, even if the previously uploaded files are not on the server anymore.
The example is for downloads with Session.GetFiles, but it will with small changes work for uploads with Session.PutFiles too.
It also points to another article: Remember already downloaded files so they are not downloaded again, which shows another method – To store names of already transferrer file to a file and use it the next time to decide, which files are new.
Short Version: I need a code which automatically uploads a file into AWS Linux server.
Longer Version: There is a software called MinKNOW which does DNA sequencing and it takes hours to complete a single sequencing. As an output it creates a file in fastq format. The output file gets bigger while MinKNOW does sequencing. I want to write a code which uploads these files into my AWS Linux server automatically once in a while.
I am trying to connect to an SFTP server with my AIR application. It doesn't matter that it's an AIR application except that I haven't found any libraries or AIR API methods for it.
My first thought is to find a library in another language and rewrite it in ActionScript. I'd rather not do that and my lack of experience may introduce security issues.
My second thought is to call a native process or command such as sftp or sshpass or curl from my main application and pass the local and remote upload locations to it and let it do the work. The downside to this is if they don't have the command installed they have to install a separate program.
My questions are:
Are these SFTP commands available by default on both Mac and Windows?
Should I store the users login (I do not want to) or prompt them to enter it each time? Does SFTP / public key remove the need for that?
I've found two related questions here and here but some of it is over my head. They also seem to be specific to *nux (which may work for Mac as well but not Windows).
I do not have the experience in this area so I would welcome those with experience to give guidance if this is a good idea or not. Overview type answers are welcome for me as I can attempt to work out the details. If no answer is given, once I've figured it out I'll post an answer. Please do not close this question (rather suggest edits).
FYI I'm using AIR to make a native process call.
An AIR application in the extended desktop profile can execute a file,
as if it were invoked by the command line. It can communicate with the
standard streams of the native process. Standard streams include the
standard input stream (stdin), the output stream (stdout), the
standard error stream (stderr).
I can also create and call a scpt, sh or bat file.
Commands installed on my Mac:
curl_init(), curl_setopt()
ssh
sftp
Commands not installed on my Mac:
sshpass
Are these SFTP commands available by default on both Mac and Windows?
No. There is no sftp nor ssh on windows by default, unless you install it through cygwin or bundle them in your application (also solution).
Should I store the users login (I do not want to) or prompt them to enter it each time?
Prompt is preferred.
Does SFTP / public key remove the need for that?
Yes, but you will have to store private key, which is almost the same like storing password.
I want to know if there is a specific entry to check in the registry to see if there is a default program associated with a specific file type?
My main example would be a PDF. Documentation in my company is mainly PDF. We want to be able to distribute the latest Adobe Reader because, generally, a lot of the PCs using my company's software will not have access to the internet.
During installation, I want to be able to check if the computer we are installing on already has a program to view PDF files. If yes, carry on. if not, then run the Adobe distribution as part of the install.
I'm focused on Windows 7 PCs, registry entry(ies) I can read programatically to see if, as an example, PDF has a valid program to open it.
No this option not exists. Although HKCR\'PROGID'\shell\open may points to the installed software.
User MC ND have wrong answer. See my screenshot:
During installation, I want to be able to check if the computer we are installing on already has a program to view PDF files. If yes, carry on. if not, then run the Adobe distribution as part of the install.
So I have pdf reader (!!!) with no associations. MC ND you are still thinks, I have no pdf reader?
From console
assoc .pdf to get the "fileType" associated to the extension. Once you have the fileType (ex. AcroExch.Document.11):
ftype AcroExch.Document.11 to get the associated program.
I am able to write to a .txt file in Windows Phone 7. I know I can read this file programmatically, but how will I be able to get this file to a PC? Where exactly is the file stored on the phone?
The SDK comes with the Isolated Storage Explorer tool which allows you to read and write files from Isolated Storage. Learn about it's usage at http://msdn.microsoft.com/en-us/library/hh286408(v=vs.92).aspx
This assumes that you're wanting to do this with files you're creating for dev/testing purposes.
If you want to make an application which allows you to create files which users can access from teh PC you're out of luck. Instead you'd need to look at emailing the info from the file or distributing the file via the web.