[sf-lug] mass copy of one file to multiple user accounts

Justin Ryan justizin at vongogo.org
Tue Sep 2 10:53:09 PDT 2008

2008/9/2 Christian Einfeldt <einfeldt at gmail.com>:
> hi
> On Tue, Sep 2, 2008 at 9:35 AM, Tom Haddon <tom at greenleaftech.net> wrote:
>> Might be easier to just serve the file from a location they can all
>> access (an internal web server, for instance)?
> Is there an easy way of doing that?  Thanks for your help, Tom!

I'd say it's a bit overkill to run a webserver on the loopback
interface for a globally accessible file.  If this file is crucial to
all users, mention its' location in your motd / network.issue, and
just put it somewhere like:

  * /usr/local/share
  * /opt/important.things
  * whatever makes you happy

Make sure the directory and file are either:

  * group readable and owned by a group all the users belong to
  * world readable

Make sure they aren't writable by said group, world, etc..

If you *really* want to make it available in users' home directories,
you can use hard links, so long as you don't cross any filesystem
boundaries, e.g. linking to a file on "/" volume when home directories
are on a separate volume for "/home".  This is easy enough with the
'ln' command:

  cd /home
  for i in *; do ln $important_file $(pwd)/important.file; done

This will just be painful to manage as you add people, if you put a
copy of the hard link in your skel, it'll be replicated via copy.

Come to think of it, you could use a symlink for this, not sure why I
thought it needed a hard link.  Just add "-s" flag to the "ln" command



Justin Alan Ryan
Independent Interaction Architect
* : +1-415-226-1199 x2600

"All because of a bunch of stuff that happened.."
 -Homer Simpson
"The best way to get in touch with me is PayPal.
 -Alexander Limi

More information about the sf-lug mailing list