LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Is there a daemon to auto rename a file? (https://www.linuxquestions.org/questions/linux-software-2/is-there-a-daemon-to-auto-rename-a-file-832455/)

xmrkite 09-16-2010 01:35 AM

Is there a daemon to auto rename a file?
 
Hello, I need a daemon that can automatically rename a file for me.

I have a program I use that downloads a file a couple times a day, but it does not name it how I want it named. So I am looking for something that i can run as a daemon that will rename the downloaded file as soon as it is downloaded to my specified directory and rename it according to my needs.

Thanks for any help provided

evo2 09-16-2010 01:49 AM

I think you may be approaching this in the wrong way. Can you not make the existing program simply save the file with a different name? What is this program?

Evo2.

crts 09-16-2010 07:33 AM

Hi,

you can use incrond to monitor your download directory
http://linux.die.net/man/8/incrond

Configure it to monitor your download directory for event
IN_CLOSE_WRITE

and then have the daemon rename it or have it call a script which will create a name as you have in mind.

xmrkite 09-16-2010 11:58 AM

Incron worked out perfectly.

Thanks for the quick help.

I would have modified the program to save the file correctly in the first place, but we do not have access to do that.


All times are GMT -5. The time now is 01:28 PM.