lgodin may be in overkill mode,
Why do you think this is needed?
Maybe on a Macintosh systems using AppleScript it might be doable. But, you'd sacrifice server security to allow external AppleScript access and control. If you are on windows I doubt it can be done but I'm not a windows expert.
Compacting a file like this not one of the FMS recommended practices and I've not heard of any need for file compression since FMP-pre7 and in-expensive drives. FMS does file clean up within the database and dynamically reallocates the internal storage blocks as required. You may not see any file size changes on the drive but that doesn't mean FMS isn't keeping the file in top shape.
If your files have grown to large for the backups to fit, get a bigger drive or add a second one. Its much cheaper than developing what you've described.