Example Three - Archiving a Fileserver
Although I don't have any real life experience with it (at least now), this is one of my favourites. But one thing you should really keep in mind here is that wcp does not work with filenames that have blanks in their names. If you follow this example instruct your users.
Setup a samba fileserver and make it run, I use a share definition like
[work] path = /var/samba/work/%U comment = Working Directories browseable = yes writable = yes create mask = 0644 directory mask = 0755
This work share gives each user a home directory (if this directory exists when he or she connects) almost likes the homes share. In fact, you can use the homes share for it but I this directory contains too much UNIX/Linux specific files. Using a separate share starts a fileserver from scratch.
Now create a second share.
[archive] path = /var/samba/archive comment = Fileserver Archive browseable = yes writable = no
The "writeable = no" is important, it protects the archive against modifications.
If one user can access the work share directory of another user on the archive share depends on the permissions you set on the work directories since the permissions will be copied into the archive. If the work directories are 700, the directories in the archive are also protected (assuming you archive as root).
The archive command. You should perhaps take some time to think about what you want to archive and what not. Temporary files, mp3, Ogg Vorbis are most likely things that don't need to archived.
A first iteration could be
wcp store /var/samba/archive -o '^tmp/|\.mp3$|\.ogg$'
will exclude files ending in either ".mp3", ".ogg" - add more extensions if you like. The "^tmp/" exclude a directory named "tmp" and all files in it. wcp adds automatically a slash to the filename for pattern matching if the name refers to a directory.
A second exclusion you might want is "exclusion by size". If files larger than, let's say, 200MB should be excluded from the archive you command would be
wcp store /var/samba/archive -o '^tmp/|\.mp3$|\.ogg$' -m 200M
Now all that's needed is a cronjob that archives once a day all files from work to archive.
Of course you can create such a setup with all kind of samba shares, not only personal work directories. For a real life setup it could be interesting to have fast, expensive and "not so large" diskspace for the workspace and slow, inexpensive but large space for the archive.