With AWS Redshift you can use the UNLOAD command to copy rows from a Redshift table to S3. There’s no single command to UNLOAD rows and DELETE them at the same time, but you can use this query to do so. This example uses a timestamp column to decide which rows to keep.

UNLOAD ('select * from events where timestamp < ''20180701''')   
TO 's3://analytics/export/unload/20180701/events_'
IAM_ROLE 'arn:aws:iam::123456789:role/RedshiftExportRole';

DELETE from traffic where timestamp < '20180701'; 

COMMIT;

VACUUM DELETE ONLY;