Announcement

Collapse
No announcement yet.

SOLVED gzip get files to zip from a textfile?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SOLVED gzip get files to zip from a textfile?

    Hi,
    Spent some time searching but couldn't find this.
    How can gzip/zip etc get the files that need to go into the zip from a textfile?
    Thanks.
    Greetings from Groningen Netherlands

    #2
    Re: gzip get files to zip from a textfile?

    Does
    Code:
    man gzip
    say this is possible? I have not heard of it, AFAIK.

    Comment


      #3
      Re: gzip get files to zip from a textfile?

      Hey dibl, hate to say it but in windows I did it all the time.
      Yes I did 'man gzip', and googled for 2 hours.
      A php script of mine generates a textfile with list of files, which then should be fed to gzip to make a zip.
      Hmm.. maybe not it's directly possible but only through some scripting..

      Well, I have another solution, but I won't mark this thread solved yet, curious if someone still comes up with something.
      Greetings from Groningen Netherlands

      Comment


        #4
        Re: gzip get files to zip from a textfile?

        Originally posted by Jean

        Hey dibl, hate to say it but in windows I did it all the time.
        "You're not in Windows any more, Jean!"



        You may be thinking of a bash script, which calls gzip and then includes directories and files to be zipped into a named archive. That's way over my head, but I would think a person who knows scripting could do a static script that lists a set of existing file names to be zipped into an archive.

        Comment


          #5
          Re: gzip get files to zip from a textfile?

          "You're not in Windows any more, Jean!"
          No kidding dibl!

          You may be thinking of a bash script, which calls gzip and then includes directories and files to be zipped into a named archive. That's way over my head, but I would think a person who knows scripting could do a static script that lists a set of existing file names to be zipped into an archive.
          Well I do scripting dibl, only I'm quite stubborn. If I used a method that worked once, I first try that method, untill I bump into a wall, well, often enoough anyway.
          Solution in this case is to add the files to the zip in the same loop that made the textfile, should work too...

          Thanks.
          Greetings from Groningen Netherlands

          Comment


            #6
            Re: gzip get files to zip from a textfile?

            You could do something like:
            Code:
            tar -czvvf Name_of_the_Archive.tar.gz -T Text_File_List_to_use_as_input
            (tar has a few advantages over just gzip, tar's man page has more options that may be of use depending on your use case scenario)

            EDIT: oops, forgot the zip option (-z) from the command

            Comment


              #7
              Re: gzip get files to zip from a textfile?

              Thanks cubicle, that's just what I was searching for. I knew it had to be possible, qed.
              Greetings from Groningen Netherlands

              Comment

              Working...
              X