Although TIMTOWTDI, I suspect you'll find that using a shell script of some sort would be easier than using Perl for this purpose. Here is an example of a cshell script which could be scheduled to run as a cron job:
#! /usr/bin/csh echo -n "** New Backup Job" >> /home/root/tape.log echo -n "** Rewinding tape . . . " >> /home/root/tape.log mt -f /dev/rmt/0 rew echo "**" >> /home/root/tape.log echo "** TAPE #1 Backup begins ("`date '+%Y/%m/%d %H:%M'`") **" >> / +home/root/tape.log echo " " >> /home/root/tape.log echo " Backing up -> /root" >> /home/root/tape.log ufsdump 0uf /dev/rmt/0n /dev/md/dsk/d20 >> & /home/root/tape.log echo " Root finished backing up ("`date '+%Y/%m/%d %H:%M'`")" >> /h +ome/root/tape.log echo -n "** Rewinding/Unloading tape . . . " >> /home/root/tape.log mt -f /dev/rmt/0 rewoffl
Please be sure to note that this is a very simple example with absolutely no error checking. You should also check out the man pages for additional requirements when using ufsdump (file systems should be inactive, run in single user mode, etc.). A more robust solution using cshell script and Perl (with error checking) can be found here. HTH.

--Jim


In reply to Re: System Calls with backticks by jlongino
in thread System Calls with backticks by Mac

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.