Assistance with archival script
Matt Snell
mattds at gmail.com
Wed Nov 19 14:21:12 EST 2008
Hi all,
I need a little help with find, or if find can't do what I need, a pointer
to the right tool for the job. Some background; I've got a base directory
where I store multiple sub directories, I will eventually write the subdirs
to individual 7z files and archive. I'm trying to automate the process
some, here's what I've got for the (admittedly rudimentary) script (at this
point I'm just echoing the actual command to the console to see what would
happen)
#!/bin/bash
DLDIR='/var/lib/samba/shares/xfer/All Downloads/incoming/'
cd "$DLDIR"
find . -maxdepth 1 -type d -exec echo /usr/bin/7z a -t7z -mx=0 {}.7z {} \;
Here's what it returns:
/usr/bin/7z a -t7z -mx=0 ..7z .
/usr/bin/7z a -t7z -mx=0 ./oh four.7z ./oh four
/usr/bin/7z a -t7z -mx=0 ./two.7z ./two
/usr/bin/7z a -t7z -mx=0 ./three.7z ./three
/usr/bin/7z a -t7z -mx=0 ./one.7z ./one
What I want to do is prevent find from outputting "." as a directory as it's
creating a file named "..7z" with each of the subdirs within it. I've had
no luck with the man pages and Google (or more likely my search phrases) has
failed me. Could anyone point me in the right direction? I'm open to
suggestion, if you know of a better way to get the job done, I'm all ears
(eyes?).
If you need more detail, please let me know.
--
MDS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20081119/455a4c68/attachment.html
More information about the gnhlug-discuss
mailing list