#!/bin/php $versions) { $versions_to_keep [] = max($versions); } $versions_to_exclude = array_diff($all_versions, $versions_to_keep); $cmd = "rsync -arvh --delete --delete-excluded --exclude '*-32bit.iso' "; foreach($versions_to_exclude as $versions_to_exclude) { $cmd .= "--exclude '$versions_to_exclude/' "; } $cmd .= " pub.linuxmint.com::pub/stable/ ./pub.linuxmint.com/stable/"; passthru($cmd, $result_code); // testing subdir $cmd = "rsync -arvh --delete pub.linuxmint.com::pub/testing/ ./pub.linuxmint.com/testing/"; passthru($cmd, $result_code);