Is it possible to write scripts to backup a SharePoint Online site through scripting ? I have seen Power Shell scripts which are used to backup SharePoint site but I am not sure if they can be used to back up a SharePoint online site.
For SharePoint Online site, Microsoft will do the backup for users. PowerShell does not help that part.
Deleted SharePoint sites are retained for 93 days. After 93 days, sites and all their content and settings are permanently deleted, including lists, libraries, pages, and any subsites.
For special requirements, just open a service request for more detailed help.
Here is a discussion which may be helpful for you:https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-online-backup-strategies-for-a-cloudy-day/m-p/225418