Why not CRON jobs etc? PHP isn't really meant for this kind of task. Executing something regularly would normally be done using something like a CRON job or something like an application running in the background.
check the helpscreens for the ftp program of preference
(ftp, filezilla, cuteftp, all have startup parameters that can connect to server, synchronize folders, exit. I assume that all do.)
Add that to the task scheduler with a half hour schedule, using guidance from the helpscreens to task scheduler.