Programming, Shell Script

Extract last day file zip with shell script

Now I get a new experience in the manipulation of files using shell script. In this condition I got a challenge to select the file on the last day, and in a compressed zip file.

I started looking on the last day of the file using the command

#find /location/file type f -ctime -1

then you can combine with unzipp command and give the location of the target folder

#find "$dir" -type f -ctime -1 -exec sh -c 'unzip -d `dirname {}`/../unzipp {}' ';'

you can run the command on a .sh file and you can run as a cron job to use.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s