Re: backup home directories



If I have 50 user directory's and specify 4 threads, then only 4
backups should run at any given time.

We would like to use Korne, Borne, or Bash to do this.

Thanks again for all your help.


Chris F.A. Johnson wrote:
On 2006-04-27, SA_IT wrote:
We are looking to backup our users home directory's on an individual
directory basis, but we want to thread it such that we can backup 'n'
number of user directory's at the same time. Basically the script
should go get the list of user directory's and then kick off 'n'
number of subprocesses to backup the first 'n'directory's. Once any
one of the subprocesses completes that process should get the next
directory in the list. This loop should continue until all directory's
have been processed.

Any scripting language, but C shell.

for dir in /home/*/ ## or custom list of directories
do
backup_script "$dir" &
done

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, is written for the POSIX locale
===== and is released under the GNU General Public Licence

.



Relevant Pages

  • Re: backup home directories
    ... directory basis, but we want to thread it such that we can backup 'n' ... number of subprocesses to backup the first 'n'directory's. ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: Create a Shell Object in ASP
    ... different Scripting Host. ... would come in handy if we could just do so by opening the web browser, ... forget something and then backup ... Aaron [SQL Server MVP] schrieb: ...
    (microsoft.public.inetserver.asp.general)
  • Re: Backup / Clear Security Log
    ... The backup is now saved to ... > to run under an account that have the necessary network access ... > Microsoft MVP Scripting and WMI, ...
    (microsoft.public.windows.server.scripting)
  • Re: backup home directories
    ... number of subprocesses to backup the first 'n'directory's. ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • cdrecord scripting question.
    ... I have a sh/bash/csh scripting question regarding cdrecord ... echo ' '>>/tmp/backup.log ... echo 'Finished Backup: '`date`>>/tmp/backup.log ...
    (RedHat)