Not sure if this is the right board, but here it goes... How would you backup the whole installation of Magento 2 into cloud service like S3, Dropbox or Drive? It would need to be done regularly and also the automatic deleting of old backups from the cloud and server should be handled.
Is there some script available somewhere or is there any extension for this?
I think you don't need to do backup of whole data, you can just setup code in git repository and schedule a daily basis of Database back for which your server provider may help.
Make sure you follow the correct git init approach.
@gaurav_harsh1 Git might work for the code base, but client wants to have a separate off site backup for ALL data (DB, media, code etc.). Hosting provider is not able to provide off site backup services. Their backups are located on the same server hall and client want's backups to be physically at another place.
I've had good experience in the past using rclone on linux but that depends if you have SSH access to your hosting provider or not?
If your on a shared hosting platform you might need to get a bit more creative and configure a daily download via FTP.
You can write a simple bash script (or have your hosting provider do it) that will automatically compress your files and dump your database, then transfer it to an offsite backup service.
If you use S3, the bash script will need to use AWS CLI to transfer the backed up files and if you use an offsite backup storage service, the backup script can incorporate utilities like Rsync, Duplicity or even Borg to transfer the backup files.