Blog

Managed File Transfer and Network Solutions

How To Zip Old Files On Your File Transfer Server

Posted by John Carl Villanueva on Wed, Apr 22, 2015 @ 07:17 PM


Overview

In a previous post, we taught you how to automatically delete old files from your file transfer server. That exercise could come in handy if you want to recover some free space from your disk drive. However, there can be instances when, instead of deleting aged files, archiving/zipping would be your desired course of action. This article can help you in that regard.

 

When is archiving the better option?

There are many instances when you just can't delete old files. Maybe they're covered by a regulatory requirement (e.g. PCI DSS requirement 3.1). Maybe it's stipulated in your data retention policy. You might need it for operational or eDiscovery purposes. Who knows? Unless you're absolutely sure that the information found in those files are totally useless, it's best to send them to a zip file instead of the trash bin.

What we'd like to do

zip_files_on_ftp_server

How to zip old files

One way to zip old files on JSCAPE MFT Server is by setting up the following:

  1. A directory monitor that would scan a specific directory for aged files;
  2. A trigger that would activate the directory monitor at some specified time; and
  3. Another trigger that would automatically zip each aged file found by the directory monitor.

We've already discussed this in the article "How To Delete Old Files From Your Server", so please go there and follow the instructions except the part in Step 3 where you add the Delete File trigger action. Instead of adding that, please add the Zip File trigger action.

 

zip-trigger-action

 

In the succeeding screen, enter the %File% variable into the File field. You can leave the Destination field blank. If you do that, the zipped file will be stored in the same directory as the original file. But if you want it to be stored elsewhere, just enter the desired target folder. 

Also, if you want to delete the original file, just tick the Delete Source check box.

zip-file-parameters

 

Note that the instructions found in that article ("How To Delete...") are designed to delete files at least a year old. Please modify accordingly. For example, you might want to change the age parameter to, say, 60 days.

Summary

If you followed all the instructions (including those in the previous post) to the letter, this is what's going to happen:

1. As soon as the clock strikes 9:30 PM, the Activate Year Old Files Monitor trigger will activate the Year Old Files directory monitor.

2. The directory monitor will dive into the directory it's assigned to monitor and scan for 1 year old files.

3. If a 1 year old file is found, the Directory Monitor File Aged event will then fire.  

4. This event will subsequently cause the Nightly File Deletes (you might want to change this to something more appropriate, e.g. Nightly File Zips) trigger to execute. 

5. The trigger checks to see whether the monitor that fired the Directory Monitor File Aged is the Year Old Files monitor. If it is, the trigger proceeds to execute its Zip File trigger action. 

6. The trigger action executes, using the value of the %File% variable to determine which file it should zip. The file in question is archived.

7. The Year Old Files directory monitor continues scanning the directory for more 1 year old files. If another one is found, the process is repeated starting at step #3. 

Note that these instructions can be used irregardless of the file transfer protocol. In other words, you can apply this to your SFTP, FTPS, HTTPS, or FTP server as long as it runs on JSCAPE MFT Server. 

Recommended read

Other articles you might find interesting:

How To Send Large Files By Email

Setting Up An SFTP Server

What Is A Digital Certificate?

 


Get Started

Want to follow the instructions for this automated file transfer? Download a copy of JSCAPE MFT Server now. A free, fully functional evaluation edition has been made available for you.

Download Now



If you like to read more posts like this, subscribe to this blog or connect with us on social media.

 

 

Topics: JSCAPE MFT Server, Managed File Transfer, Business Process Automation, Tutorials