Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am creating a python script which will move the fresh zipped files to a hotfolder. But when i am creating a zip file with zip test.zip /opt/test it creates a temp file first, something like xAbCG77, then it renames it to test.zip, is there any way to create the zip files with the original name, or is there a way to track what is going to be the name of that file, is it a hash for the name?

Thanks.

share|improve this question
    
But if it creates the zip file, and then renames it, you can't just wait until it renames and then move the final (correct name) file ? –  woliveirajr Oct 8 '13 at 14:03
    
i am running a scan in every five minutes, and i have some really heavy zip files which are getting created by other users on network. –  abhishekgarg Oct 8 '13 at 14:10
1  
@woliveirajr I think he is creating it directly in the hotfolder. The zip I use creates a temp-file in the current directory so you could try to execute the zip command in a different directory then the holtfolder and doing zip /hotfolder/test.zip /opt/test. You could also created somewhere else and move it. –  Rik Oct 8 '13 at 14:10
1  
zip -/opt/test > test.zip works.. thanks a lot –  abhishekgarg Oct 8 '13 at 14:15

1 Answer 1

up vote 1 down vote accepted

It depends on your zip version. My zip creates the temp-file in the current directory.

You could try something like zip - /opt/test > test.zip but it depends on your zip-version if this works.

I would just do a cd /tmp and then execute zip /hotfolder/test.zip /opt/test. This way your temp-file is created in your /tmp and moved directly after successful creation.

share|improve this answer
    
thanks for the help –  abhishekgarg Oct 8 '13 at 14:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.