Free

Free coded apps to suit all. No sign up, no email, usable offline, updates when I can, feedback welcome. Send feedback

How-to

How to tag files on the server by size and age

Use Tag by in FTP by Zaweba's Disk to tag server files by type, size and how long ago they changed, then download, move or trash them together.

How to tag files on the server by size and age

Tag by, in the Disk view of FTP by Zaweba, is built for this. Choose a size test (at least, over or at most) and an age test (modified so many days ago, or within so many days), add a type or filespec if you like, and say where to look. The matching files are tagged, and you can then download, export, move, rename or trash them together.

Picking files one by one is fine for ten. For the four hundred images over 1 MB that nobody has touched in three years, it is not.

What tagging is for

A tag is a mark on a file in Disk's scan that says "this one is part of what I'm working on". Tags let you gather a set of files from all over a site and act on them as one. You can tag files in the list or the tree, tag or untag a whole folder, tag everything currently listed, invert the tags, or clear them all and start again.

Tag by does the gathering for you from a description.

Tagging by size and age

Open Disk from the toolbar or the Site menu and let it scan. Open Tag by.

For size, choose whether you want files that are at least, over or at most a certain size, and enter it. For age, choose modified days ago, for files untouched for at least that long, or within days, for recent ones. You can add a filespec such as *.zip or a type to narrow it further.

Then choose where to look: the current list, this branch, or the whole scan. Looking in one branch is good for a single folder such as an old uploads year. Looking across the whole scan finds strays anywhere.

Run it and the matching files are tagged. Check them in the list before doing anything.

Doing something with the tagged files

Tagged files can be downloaded together, which is the right first step for anything you might want later. They can be exported, so you have a record of what they were. They can be moved, perhaps into an archive folder outside the public web folder, or renamed with bulk rename. And they can be sent to the trash, with a batch confirmation that can offer to download a backup first.

Protected paths, such as .htaccess, wp-config.php, .env and cPanel folders, are left out of these actions unless a site option allows changes to them.

Using colour to choose your numbers

Before you set the numbers, look at the treemap. Disk can colour it by file type or by age. Colour by age and the old parts of a site stand out at once, which helps you choose a sensible number of days. The biggest 100 list does the same for size: if the hundredth biggest file is 2 MB, that is a fair place to set an over test.

A worked example

Say a hosting account is near its limit. You colour the treemap by type and see that images take most of the room. Tag by with type set to images, over 1 MB and modified more than 730 days ago, across the whole scan, tags the old heavy pictures. You download them as a backup, then open the pages that use them and decide which to replace with smaller copies from Save for Web and which to remove.

If you move or rename any of them, link awareness lists the references to the old paths in your local site and can rewrite them. If you change your mind about any batch, the operations log can undo it.

Getting the most from Tag by

Invert is underused. Tag the files you want to keep, invert, and you have everything else. Clear all before starting a new job, so leftover tags from earlier don't sneak into a batch. And with the tagged files listed, export the list as shown to CSV before a big clean up; it is the simplest record you can keep of what FTP by Zaweba is about to change.