Find the answer to your Linux question:
Results 1 to 3 of 3
I am writing a script that will allow me to gather logs and pull them together to be zipped, however, when I go to zip them, I want to be ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2009
    Posts
    8

    Zip file help


    I am writing a script that will allow me to gather logs and pull them together to be zipped, however, when I go to zip them, I want to be able to have the script save the zip file as <machinename>.zip. How do I get the script to do this?

    Please bear in mind that I ma new to scripting in Linux (I managed to piece this thing together pretty succesfully, but still need some wisdom).

    Thanks ahead of time.

  2. #2
    Just Joined!
    Join Date
    Aug 2010
    Posts
    18
    Hope this would help:

    If the file list is specified as -@,
    [Not on MacOS] zip takes the list of input files from standard input.
    Under UNIX, this option can be used to powerful effect in conjunction with the find(1) command. For example, to archive all the C source files in the current
    directory and its subdirectories:
    find . -name "*.[ch]" -print | zip source -@
    man zip

  3. #3
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    and the hostname is here:

    Code:
    man hostname

Posting Permissions

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