Im not sure I gather what you mean a naming convention or simply cat to the tar. The tar files are created using a naming convention username-month-date-year.tar. I know it would be better to just tar /usr/spool/mail but I have a few mailboxes that are quite large (IMAP SERVER) and dont want to backup as frequently. Im going to modify the script to backup a few additional things (a few user directories, etc) so will probably have it tar something like:(PSEUDOCODE)

cd /var/spool/;tar -cvf /tmp/mail-bkup.tar $name1 $name2 .. cd /home; tar -cvf /tmp/user-bkup.tar $user1 $user2 .. cd /tmp; tar -cvf backup-$todays_date.tar mail-bkup.tar user-bkup.tar

Good point about checking the zip disk, I didnt think about that. The backup has been done, Just dont know on which disk!

Im not using modules such Archive::Tar because I am trying to better understand using perl as a glue language. I come from windows background and need the experience playing with the unix tools.

Currently the err checking is laughable, I know. This is just a test script that Im using from the command line and want to see whats going on. I think Ill take your sugestion and have it mail me any errors. How could I grab errors reported by tar and gzip? Can I grab standerr somehow?


Thanks!
zzspectrez


In reply to RE: Re: Using perl to automate mail backup by zzspectrez
in thread Using perl to automate mail backup by zzspectrez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.