I am trying to create a Google Drive app that can run in the background (e.g. a cronjob), without any user interaction, using Google Drive SDK Service Account, but it gives
Service Accounts is not supported by the Drive SDK due to its security model.
What I would suggest is to open (or create) a file from the Drive web UI with your application and store the retrieved access and refresh tokens you get after the OAuth 2.0 authorization flow has completed.
From your cron job, simply retrieve those credentials to send authorized requests to the Drive API on behalf of your user.