lftp if you don't have it yet. Then create a bash script containing the following:
lftp -f "
user <username> <password>
mirror --reverse --delete --verbose $SOURCE $TARGET
<password> with your actual data.
This will effectively sync your local files to the remote folder, deleting everything that doesn't exist locally anymore (this is the
--reverse specifies that you want to actually update your remote folder instead of your local one.
Have a look at
lftp's man page for more details. And always have a backup ready so you don't delete anything in case a command goes wrong.
This is adapted from this script here.