Re: tar backup script

2008-02-14 Thread The MadDaemon
I believe the -T switch in tar is for include the files in {file}

tar cvf myfile.tar -T path/to/include


On 2/14/08, Wael Nasreddine [EMAIL PROTECTED] wrote:
 This One Time, at Band Camp, Steel City Phantom [EMAIL PROTECTED] said,
 On Wed, Feb 13, 2008 at 10:57:22PM -0500:
  this isn't really bsd specific but i still need help with it.  im writing
 a
  backup script  a clip from that script is this:

  find /usr/local/www/data-dist/ -name config.php 
  /usr/local/backupScript/include
  find /usr/local/www/data-dist/ -name ClientFiles 
  /usr/local/backupScript/include

  tar cvf /usr/local/backupScript/files/www-client-files.tar -I
  /usr/local/backupScript/include /usr/local/www/data-dist

  obviously im creating an include file from a directory.  when the tar
 runs,
  it correctly adds all the files in the include file.  but once that is
  finished, for some reason tar then goes back and adds all the files that
 are
  in the /usr/local/www/data-dist directory, even the ones in the include
  file.  i was under the impression that the -I command would add ONLY the
  files that are listed in the include.  why is it adding those and then
 after
  finishing that, adding all the others?

 Why won't you just do it this way??

 $ tar cvf /usr/local/backupScript/files/www-client-files.tar $( cat
 /usr/local/backupScript/include )

 --
 Wael Nasreddine
 http://wael.nasreddine.com
 PGP: 1024D/C8DD18A2 06F6 1622 4BC8 4CEB D724  DE12 5565 3945 C8DD 18A2

 .: An infinite number of monkeys typing into GNU emacs,
would never make a good program. (L. Torvalds 1995) :.



-- 
It said use Linux 2.4 kernel or better so I installed FreeBSD.  Now
everything runs better.  Why didn't they just tell me to do that to
begin with?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tar backup script

2008-02-14 Thread Lowell Gilbert
Steel City Phantom [EMAIL PROTECTED] writes:

 this isn't really bsd specific but i still need help with it.  im writing a
 backup script  a clip from that script is this:

 find /usr/local/www/data-dist/ -name config.php 
 /usr/local/backupScript/include
 find /usr/local/www/data-dist/ -name ClientFiles 
 /usr/local/backupScript/include

 tar cvf /usr/local/backupScript/files/www-client-files.tar -I
 /usr/local/backupScript/include /usr/local/www/data-dist

 obviously im creating an include file from a directory.  when the tar runs,
 it correctly adds all the files in the include file.  but once that is
 finished, for some reason tar then goes back and adds all the files that are
 in the /usr/local/www/data-dist directory, even the ones in the include
 file.  i was under the impression that the -I command would add ONLY the
 files that are listed in the include.  why is it adding those and then after
 finishing that, adding all the others?

You specified /usr/local/www/data-dist on the command line, so you get
the directory and everything in it.  The -I command *does* add just
the files in the include file, but then specifying data-dist
explicitly gets everything in it.  
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tar backup script

2008-02-14 Thread Derek Ragona

At 09:57 PM 2/13/2008, Steel City Phantom wrote:

this isn't really bsd specific but i still need help with it.  im writing a
backup script  a clip from that script is this:

find /usr/local/www/data-dist/ -name config.php 
/usr/local/backupScript/include
find /usr/local/www/data-dist/ -name ClientFiles 
/usr/local/backupScript/include

tar cvf /usr/local/backupScript/files/www-client-files.tar -I
/usr/local/backupScript/include /usr/local/www/data-dist

obviously im creating an include file from a directory.  when the tar runs,
it correctly adds all the files in the include file.  but once that is
finished, for some reason tar then goes back and adds all the files that are
in the /usr/local/www/data-dist directory, even the ones in the include
file.  i was under the impression that the -I command would add ONLY the
files that are listed in the include.  why is it adding those and then after
finishing that, adding all the others?


As you have found -I which is the same as -T will read the file, and in 
create mode add those files to the tar volume, but then the next param is 
read as another pattern to archive.  Why not do just:

tar cvf /usr/local/backupScript/files/www-client-files.tar -I
/usr/local/backupScript/include

-Derek

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: tar backup script

2008-02-13 Thread Wael Nasreddine
This One Time, at Band Camp, Steel City Phantom [EMAIL PROTECTED] said, On 
Wed, Feb 13, 2008 at 10:57:22PM -0500:
 this isn't really bsd specific but i still need help with it.  im writing a
 backup script  a clip from that script is this:

 find /usr/local/www/data-dist/ -name config.php 
 /usr/local/backupScript/include
 find /usr/local/www/data-dist/ -name ClientFiles 
 /usr/local/backupScript/include

 tar cvf /usr/local/backupScript/files/www-client-files.tar -I
 /usr/local/backupScript/include /usr/local/www/data-dist

 obviously im creating an include file from a directory.  when the tar runs,
 it correctly adds all the files in the include file.  but once that is
 finished, for some reason tar then goes back and adds all the files that are
 in the /usr/local/www/data-dist directory, even the ones in the include
 file.  i was under the impression that the -I command would add ONLY the
 files that are listed in the include.  why is it adding those and then after
 finishing that, adding all the others?

Why won't you just do it this way??

$ tar cvf /usr/local/backupScript/files/www-client-files.tar $( cat 
/usr/local/backupScript/include )

-- 
Wael Nasreddine
http://wael.nasreddine.com
PGP: 1024D/C8DD18A2 06F6 1622 4BC8 4CEB D724  DE12 5565 3945 C8DD 18A2

.: An infinite number of monkeys typing into GNU emacs,
   would never make a good program. (L. Torvalds 1995) :.


pgprqnjIuHEYt.pgp
Description: PGP signature


tar backup script

2008-02-13 Thread Steel City Phantom
this isn't really bsd specific but i still need help with it.  im writing a
backup script  a clip from that script is this:

find /usr/local/www/data-dist/ -name config.php 
/usr/local/backupScript/include
find /usr/local/www/data-dist/ -name ClientFiles 
/usr/local/backupScript/include

tar cvf /usr/local/backupScript/files/www-client-files.tar -I
/usr/local/backupScript/include /usr/local/www/data-dist

obviously im creating an include file from a directory.  when the tar runs,
it correctly adds all the files in the include file.  but once that is
finished, for some reason tar then goes back and adds all the files that are
in the /usr/local/www/data-dist directory, even the ones in the include
file.  i was under the impression that the -I command would add ONLY the
files that are listed in the include.  why is it adding those and then after
finishing that, adding all the others?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]