Ubuntu :: Run A Program Automatically When A File Appears In A Directory?
Jan 16, 2010
Does anyone know how I can make a program run automatically when a file appears in a particular directory? I have two computers, one to program the firmware on a microcontroller (command line only), and the other is my desktop machine running Ubuntu. I have an NFS share between the two. What I want is to be able to drop a new firmware load into the shared directory from the desktop, and have the other computer notice it and program the microcontroller with it. Right now I have to open an SSH session to the other computer, run the program manually, and then delete the file. I would like to automate all of that.
Is there any program/script that can create a torrent file for each file in a directory? I have been looking all over but can't seem to find anything of the sort. I have 700+ files I REALLY don't want to make my self.
Is there a way to have a directory automatically change the permissions of a file that is written to it? I have a program which saves files to a directory, and gives those files read-only permissions to members in the group. This is a problem, because other users of my computer need to be able to edit these files. The directory itself has rw permissions for group members.
I guess what I am looking for is a way for the directory permissions to "override" the permissions the program is trying to save the files as. For example, if the directory has "rw" permissions for the group, then any file saved to it will automatically get the same permissions, regardless of what the program writing the file is trying to do.
I have two questions:How do I remove files from Directory A if their name appears in Directory B?How do I move foo.jpg and bar.jpg from Directory C to Directory D if and only if foo.png and bar.png appear in Directory D?I suspect there's probably a bash one-liner for this, but...I can't come up with it.
is a file association to a program that will only run in it's own directory. (Arobas' Guitar Pro, if you're curious). The link created by the installer leads to a shell script, which cd's to /opt/GuitarPro6, then executes the program there. Attempting to call the program from outside that directory fails, as the program cannot find it's libraries. It starts normally otherwise.
Passing a file name to the program via the command line works fine, IF you start with the working directory as above. The question is, what can I do to pass the filename to the command line in the shell script, so that double-clicking in Nautilus brings up the program with the file? (Currently, just associating with the shell script gives me the program, with no loaded file).
Second issue is files with an .hjt extension. They're essentially text files, following a specific format used by Treepad. Nautilus recognizes them as text files. When I change their association to Treepad, regular .txt files follow this change, and when I change the .txt's back to Leafpad, the .hjt's follow. How can I separate the .hjt's from the .txt's?
I wrote a program in c++ on fedora 11. When i compiled it using g++. it displays the following error:
g++ fibnocci.cpp fibnocci.cpp:2:22: error: iostream.h: No such file or directory fibnocci.cpp: In function int main(): fibnocci.cpp:8: error: cout was not declared in this scope fibnocci.cpp:8: error: endl was not declared in this scope
but in index.html appears the following screeshot.jpg. create.html and index.html are both in /var/www directory. Why create.html appears in /cgi-bin directory?
When I try to run a program from the terminal, bash reports "No such file or directory", even though the file exists, is executable and I have permission to run it. The same program worked in the past.
I recently removed Winblows Vista from my laptop and replaced it with Kubuntu 10.10 (I left the recovery partition on there, just in case). When I turn on the computer, the GRUB menu appears, I press enter, then a little flashing underscore appears on the screen in the top left hand corner. After a few seconds, the Kubuntu logo appears and I can log in.But yesterday I replace Kubuntu with Ubuntu 10.10. The Boot process is the same, but the little flashing underscore in the top left hand corner flashes for about 10 seconds longer then Kubuntu 10.10 did, and then a few paragraphs of text appears for a few seconds, then I am logged in automatically.Is this "unusual" boot process anything to worry about, or am I just being a noob.
How to make sure that when I save a pdf file, the file extension .pdf appears in the filename? Its a silly little thing, but annoying. The file browser recognises it afterward as a pdf file though, it opens with document viewer ok.
I'm trying to get a program to automatically reload if I accidentally close it. This is a remote access program, so it has to be relaunched without me doing anything to help it along if it crashes or I accidentally close it. I noticed that someone came up with a way to solve this back in 2007 [URL].. but the files don't appear to exist any more for it to work. how I might get a program to automatically reload on exit?
I need a program that automaticly runs this command in the terminal when I use it: sudo modprobe nvidia_g210m_acpi Sure, I know that it's not that hard to just write it in terminal and so on, but I really want a program for it. I'm using ubuntu 11.04 if U need to know that?
A server like Lighttpd or Apache starts automatically at boot after you install it. How do I stop it from auto starting? I'd prefer to manually start it when I need it.
I have a script I would like to have automatically invoked every time the screen is unlocked. Does Ubuntu provide some support for users who wish to do this?
I am writing from lucyd. When I insert a blank CD opens a Nautilus window that asks me what program I want to use to open the CD. The last time I chose cd creator, and thereafter it no longer asks me what to do. How can I change this?In other words how can I choose another program to open automatically blank cds??
When I run the updates option on it, it tells me that the virus engine is out of date. However, it does not automatically download it, nor does it suggest a site. Is there a way to get the program to automatically download updates? If not, can you direct me to a site that would have the updates?Also, if there is a more newbie-friendly or perhaps more reliable anti-virus program, could someone direct me to it?
I have a problem with streaming from .mov from Appl.com. As most of you must know, the iPhone 4 was announced in WWDC 10 on Monday. I am interested in it and I wanted to watch the keynote (available at different resolution:[URL]... When I click on low-large resolutions, Totem opens up and I get this error message:
Code: GstDecodeBin2: This appears to be a text file When I click the HD , totem opens, and video starts streaming, but it is of a terrible quality (so much for Apple's "perfect presentation" rep). I'm not so sure this is so much a problem of Ubuntu as of my network connection. I have heard that "live" streams are not of that great quality because the video player is prioritizing to deliver live continuous stream, I can understand that. But I want quality video. So, can any of you Linux guru's (I am a newbie) tell me if this is a problem with Ubuntu (not proper mov codecs?), my connection? Apple?
Also, as I understand it, if I were to download the stream, it would have full quality because the player isn't focusing on delivering it live. Is there any app/Firefox extension/hack/terminal code, etc.
This header file no longer appears when it is set as the "stylesheet/imags/heading banner"
Ubuntu 11.04 GnuCASH v.2.4.2 (from the ubuntu 11.04 repos)
This worked in GnuCASH Ubuntu 10.04 (gnucash 2.2.9-5) but no longer works after doing a clean install followed by copying ~/.gnucash and ~/.aqbanking back into place. The rest of the attributes of both my custom Invoice & Report stylesheet still work (ie colours, etc.) but even when creating a brand new custom stylesheet I cannot get these images to appear after adding them to a stylesheet and saving the settings. This worked fine in the previous version of the application. I have tried deleting the old stylesheet(s) and recreating from scratch and the only thing that does not work is placing the banner or logo images where they are supposed to be. I've done an strace to verify that the image is being found: it's just not appearing.
[code]...
I have asked around on IRC (irc.gnome.org #gnucash) and it was suggested that it might be a webkit issue, libwebkitgtk is verified as installed.
i want my computer to function as an alarm clock, i want it to be shut down but start up automatically at a desired time (i'll also have tomboy notes display reminders of what i need to do for the day) this would be a great program
I have installed real player 64 bit version from here . The player was installed properly but its not playng .rm files. Real player window appears but does not play file.
I have made a persistent live usb of suse 11.2 using a '.iso' file. Now when I boot from the Live usb, the file system appears read only. I want do some modifications in the files.