Professional Web Applications Themes

Script question - Sun Solaris

I have a backup script on my machine : for md in $(nawk ' $1 !~ /^#/ && $4=="UFS" {print $1} /etc/vfstab) do ufsdump 0fu /dev/rmt/oun ${md} done Can somebody translate it for me, I need to know which folders are backingup on my machine. Thanks in advance....

  1. #1

    Default Script question

    I have a backup script on my machine :

    for md in $(nawk '
    $1 !~ /^#/ && $4=="UFS" {print $1}
    /etc/vfstab)

    do
    ufsdump 0fu /dev/rmt/oun ${md}
    done

    Can somebody translate it for me, I need to know which folders are backingup
    on my machine.

    Thanks in advance.


    Rob Guest

  2. #2

    Default Re: Script question

    "Rob" <com> writes:
     

    You are missing a closing ' after {print $1}
     

    Well, it backups all file systems of type UFS (none in my case since all
    mine are of type ufs). To figure it out, just run

    nawk '$1 !~ /^#/ && $4=="UFS" {print $1}' /etc/vfstab

    on a command line.

    HTH, Dragan


    P.S. You should be really backup rdsk devices, so I would change the above
    print command to print $2.


    --
    Dragan Cvetkovic,

    To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer

    !!! Sender/From address is bogus. Use reply-to one but remove .NOSPAM !!!
    Dragan Guest

  3. #3

    Default Re: Script question

    >> On Fri, 26 Sep 2003 18:14:07 -0400, [/ref]
     
     
    ^^^^^^^
    file systems
     

    ^^^^^^^^^^ print the
    mount point

    ^^^^^^^^^ 4th field is "UFS"
    (should be "ufs")

    ^^^^^^^^^^ line doesn't start with a comment

    So it's looking for all entries in /etc/vfstab that are
    "live" ufs file systems (take a look at /etc/vfstab and it
    should be obvious).

    If you just want to backup file systems that are mounted,
    look at /etc/mnttab (but see the man page).

    hth
    t
    Tony Guest

  4. #4

    Default Script question

    Hi,
    how can I run a script automatically, I need to run it right now and every
    time we reboot the machine it automaticaly starts.
    Does a script file need to have specific extensions to be executable?
    Thanks in advance.


    Rob Guest

  5. #5

    Default Re: Script question

    >> On Wed, 8 Oct 2003 09:42:50 -0400, [/ref]
     

    Just run it from its rc?.d directory, e.g.

    /etc/rc2.d/S88sendmail start

    See

    http://www.science.uva.nl/pub/solaris/solaris2.html#q3.19

    for more info.
     

    Nope, if it's executable, it's executable.

    hth
    t
    Tony Guest

  6. #6

    Default Re: Script question

    Rob wrote: 

    Rob,

    You probably need to look into the /etc/init.d and /etc/rc*.d run-level
    change scripts. That is what dictates the startup and shutdown process
    of the machine. But, be careful, as if you get something wrong it can
    be rather bad.

    A script should have the execution bit set [chmod +x] for execution at
    the command line as just itself. Non-executable scripts can be run
    using the shell first and passing the script name as parameter.

    E.g:

    If script has exec bit set......

    % script

    If script doesn't have exec bit set........

    % sh script

    Or whatever shell/interpreter

    Hope that helps
    Ade

    Ade Guest

Similar Threads

  1. Action Script Question
    By Link in forum Macromedia Flash
    Replies: 2
    Last Post: August 11th, 04:14 AM
  2. script question for BG change
    By gregkr webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 6th, 11:39 AM
  3. script question - urgent
    By Cypherpunk@nyc.rr.com in forum Sun Solaris
    Replies: 3
    Last Post: August 8th, 03:32 AM
  4. Script question
    By Aaron in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: July 24th, 02:46 PM
  5. ASP -> PERL Script QUestion..PLEASE
    By Tassilo v. Parseval in forum PERL Modules
    Replies: 0
    Last Post: June 28th, 05:26 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139