RE: scripting problem
- From: "Steven Buehler" <steve@xxxxxxxxxxxx>
- Date: Mon, 28 Jan 2008 15:09:10 -0600
Actually I do. But it is more complicated than that. If I tgz up
the /home/user directory, then the tgz file would be over 10GB in size.
Breaks the 2GB limit. So I get a directory listing and then tgz up each
directory individually so that it doesn't give me any tgz file larger than
2GB in size. I can post the whole script if anybody wants, but I wanted to
get a few bugs out of it before releasing it to the general public.
I found this problem when I was baking up a VMware Virtual machine.
There are 2 files that have spaces in them:
Red Hat Linux.vmsd
Red Hat Linux.vmx
So when the script runs, it breaks them apart at the spaces and
tries to tar up "Red", "Hat", Linux.vmsd and Linux.vmx
Thanks
Steve
-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx [mailto:redhat-list-
bounces@xxxxxxxxxx] On Behalf Of Aaron Bliss
Sent: Monday, January 28, 2008 3:01 PM
To: General Red Hat Linux discussion list
Subject: Re: scripting problem
Steve,
The easiest way to work around the space problem is to just use tar to
backup the home directory.
Aaron
Steven Buehler wrote:
I am hoping that someone here can help me with this. I am running alittle
script that backs up some directories for me. Below is snippet thatgets me
into trouble.When
---------------------
#!/bin/sh
DIRSTOBACKUP=`/bin/ls -d1 /home/user/*`
for NAMEDIR in ${DIRSTOBACKUP[@]}
do
echo $NAMEDIR
done
---------------------
The problem is that some of the directories have spaces in the names.
running the for loop, it will take the new NAMEDIR at the space. So"Red
Hat" would end up listing as 2 directories, "Red" and "Hat". Any wayaround
this?
Thanks
Steve
--
Aaron Bliss
Systems Administrator
SUNY Brockport
(585) 395-2417
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- References:
- scripting problem
- From: Steven Buehler
- Re: scripting problem
- From: Aaron Bliss
- scripting problem
- Prev by Date: RE: scripting problem
- Next by Date: Re: scripting problem
- Previous by thread: RE: scripting problem
- Next by thread: Re: scripting problem
- Index(es):