This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.
To schedule a cronjob on azure app service Linux web application you can follow the steps outlined below,
Navigate to “SSH” from azure app services portal and click on Go ->
Create a script file in /home with name as start.sh and add the below lines to the script file and save the file.
Command to create a script file - touch /home/start.sh
Open the file using vim editor: vi /home/start.sh and copy the below code
Post that, you can add the created script as a startup command which would install the cron, start the cron and schedule the cron during startup. To add as a startup command, navigate to Azure portal -> Configuration blade -> General settings tab and provide as below,
In the above sample code, it checks for all the files with size 1KB in /home/BackupLogs and delete them for every minute.
Based on your convenience you can adjust the CRON scheduler time and command