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.
Maybe use another cloud storage? Or just download all the data and upload it back after installation. There are powerful free cloud storage websites that would be a nice option for this transition. It might be even faster because some allow uploading from other cloud services. This way, the upload speed will be way higher than from your PC. It will save you a lot of time, and you will be able to process the installation process faster. But I would not do backup at all because it’s a rather safe procedure, and I think nothing would happen to files in the cloud because of it.