Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 11-24-2011, 08:17 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 8

Rep: Reputation: 0
Question Same files on distinct directory trees

or what I would call File System Views.

So here is the problem.

An application monthly generates a set of files and directories on its own way. I need these files to be accesed readonly from an user (through samba, so file system permissions aren't trouble) on a more friendly way. A simplified example:

The application generates those files:


and I want the user to view something like:


where the relationship between codes and names are known for me.

The application creates new files or overwrites previously generated ones. My target is that the user could access his view of the files so they are the last version generated by the application.

So here is my idea:

Use inotifywait, watching for create events, and execute a script that links the original file to its ubication on the user view as soon as new file is created. This way, the user view is updated almost simultaneously as the files are created and modified (I'm talking about links) by the application while no extra space is required on the server.

So here are my doubts:

┐Is there a more straight and simple solution I'm not aware of?

If my idea feels ok ┐should I use soft or hard links? Files will be on the same filesystem, so I can use hard links. But the application generates also directories that I can't hard link and I will have to traverse source directory making directories and linking files on destination, which could be not so straight.

Thanks in advance.
Old 11-25-2011, 05:01 AM   #2
LQ Newbie
Registered: Oct 2008
Posts: 8

Original Poster
Rep: Reputation: 0
It seems that my assumption of samba share not affecting at all is far to be true (
It's of course a matter of how I organize the files, but to be able to use soft links I must disable [unix extensions] and enable [wide links] directives on samba configuration. So if I want to stick with default samba configuration and consider both Windows and Linux clients, I must use hard links.

On the other side of investigation, I will not need to traverse anything due to the inhability of hardlinking directories. As application generates directories itself and inotify takes account of this, I can make directories as soon as application does. And cp -al comes to the rescue as an one-for-all solution making dirs and linking files as desired.


filesystems, hard links, inotify, samba

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge directory trees mrwall-e Linux - Software 5 02-20-2011 08:37 AM
mkisofs and preserving directory trees crontab Linux - Software 2 03-27-2009 10:00 AM
LXer: Protecting directory trees with gpgdir LXer Syndicated Linux News 0 04-25-2008 12:20 AM
Q: on deleting directory trees n00bJoe Arch 3 03-09-2006 12:13 PM
How to keep 2 directory trees synchronised? hrr Linux - General 2 07-02-2003 12:01 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration