HPC/Sharing Files: Difference between revisions

From CNM Wiki
< HPC
Jump to navigation Jump to search
Line 5: Line 5:
== Sharing Types ==
== Sharing Types ==


=== Using a Unix group ===
=== Using a project group ===
This way of sharing files is suitable for ongoing interactions between users.


* This option is suitable for ongoing exchanges.
[mailto:[email protected]?Subject=ad-hoc%20group Request a project group and directory] by mail and send the following information:
# a ''group name'' which should be short (up to some 8 chars), descriptive, and distinctive.
# the ''user list'' (later changes are easy).
 
* A new group will be created and users will be made members of that group. To pick up such a change, log out and back in.
* A group directory will be created and can be accessed by one of the following names:
* A group directory will be created and can be accessed by one of the following names:
  /home/share/''groupname''
  /home/share/''groupname''
  ~''groupname''
  ~''groupname''
* The directory will be mutually readable and writable among group members, and will not be accessible by other users.
* This directory will be mutually readable and writable among group members, and will not be accessible by other users.
* Permissions will be inherited to all files placed there.
* The group will usually be inherited by all files and directories created there.
Typically, such a group name and directory is created automatically for each CNM proposal that has more than one user. You can access the shared directories for proposals by one of the following:
 
==== Sharing within proposals ====
Typically, a project group and associated sharing directory are created automatically for each CNM proposal that has more than one user.
Access those directories under one of the following names:
  /home/share/cnm''12345''
  /home/share/cnm''12345''
  ~cnm''12345''
  ~cnm''12345''
The '''''system admin''''' can create a project group and directory for you.  To [mailto:[email protected]?Subject=ad-hoc%20group request the creation of a group], please send the following information:
# a ''group name'' which should be short (up to some 8 chars), descriptive, and distinctive.
# the ''user list'' (later changes are easy).


==== Giving write permission ====
==== Giving write permission ====
Carbon's /home/share directories are usually configured such that users of a group can read files and directories but not write, which is reserved for the owner.
Carbon's /home/share directories are configured such that users of a group can read and write files and directories.
However, when you ''move'' existing directories and files from somewhere else into the shared directory they may not be writeable for the group.
 
* To make files writeable by group members:
* To make files writeable by group members:
  chmod g+w file ...
  chmod g+w file ...
* To make a directory and all files thereunder (-R) group-writeable, which includes the ability to ''delete'' files:
* To make a directory and all files thereunder (-R) group-writeable, which includes the ability to ''delete'' files:
  chmod -R g+w dirname
  chmod -R g+w dirname
Lean more about [http://linuxfrombeginning.wordpress.com/2008/09/25/linux-command-9-chown-chgrp-chmod/ chmod, chown, and chgrp].


=== Sharing in your own directories ===
=== Sharing in your own directories ===

Revision as of 20:18, December 5, 2012

Introduction

When you collaborate with other users on a common project on Carbon, you may wish to share files among you. There are several ways to achieve this, largely distinguished by how often and for how long sharing is needed.

Sharing Types

Using a project group

This way of sharing files is suitable for ongoing interactions between users.

Request a project group and directory by mail and send the following information:

  1. a group name which should be short (up to some 8 chars), descriptive, and distinctive.
  2. the user list (later changes are easy).
  • A new group will be created and users will be made members of that group. To pick up such a change, log out and back in.
  • A group directory will be created and can be accessed by one of the following names:
/home/share/groupname
~groupname
  • This directory will be mutually readable and writable among group members, and will not be accessible by other users.
  • The group will usually be inherited by all files and directories created there.

Sharing within proposals

Typically, a project group and associated sharing directory are created automatically for each CNM proposal that has more than one user. Access those directories under one of the following names:

/home/share/cnm12345
~cnm12345

Giving write permission

Carbon's /home/share directories are configured such that users of a group can read and write files and directories. However, when you move existing directories and files from somewhere else into the shared directory they may not be writeable for the group.

  • To make files writeable by group members:
chmod g+w file ...
  • To make a directory and all files thereunder (-R) group-writeable, which includes the ability to delete files:
chmod -R g+w dirname

Lean more about chmod, chown, and chgrp.

Sharing in your own directories

You can give access to some of your directories in your respective $HOME or $SANDBOX by opening permissions.

  • This option is typically useful for one-way sharing.
  • For bidirectional sharing, you will need to grant world-write permissions, which is not recommended for files in your own directory space.
  • You will likely need to repeatedly open permissions (chmod) for additional files that are placed there.

You as the owner can arrange this on your own as follows:

chmod a+x $HOME/
mkdir $HOME/share
# populate ..
chmod -R a+rX $HOME/share
This will yield read ("r") and execute ("X") permissions for all users ("a"), meaning users can browse directories, and read and execute already executable files there.
You may have to repeat the last step after you add files in the shared directory.

Direct your fellow users as follows:

cd /home/owner/share
ls
cp -p ....

If you have particularly large files, replace $HOME and /home by $SANDBOX and /sandbox, respectively.

Using a /tmp directory

  • suitable for one-off exchanges
  • typically fairly loose permissions
  • resides on only one host
  • world-write not recommended
  • likely to need chmod whenever more files are placed

You can arrange this on your own as well:

mkdir /tmp/foo
# populate ..
chmod -R a+rX /tmp/foo