Forum Discussion
F5 OS r-Series cron job schedule
Hello All,
I am looking for some assistence to schedule a cron job on the F5 OS host for taking regular backup for the F5 host system and exporting it to the remote path.
I am trying to execute commands from bash terminal however it doesnt seems to be working.
Is there a way we can run commands using admin username to get the output from the F5 OS.
[root@appliance-1(hostname) ~]# su - admin -c show system
Invalid command
6 Replies
For a cronjob I have not tried this myself but you can use the rSeries RESTCONF API for such tasks as I have made an article about this:
- ashu_aggarwal1
Altocumulus
Thank you for the response. Will try using RESTCONF API.
Hello, Did you manage to solve your issue?
- ashk
Cirrus
Hello Ashu, wanted to know have you achieved this in F5OS? could you please share on how you are doing this in current set?
Hi Ashu,
It sounds like you're trying to schedule a cron job on an F5 OS r-Series system to automate backups and export them to a remote path.
Here are some simple steps and tips to help you achieve this:- Cron Job Setup:
- First, ensure you have the correct syntax for your cron job. You can edit the crontab file using crontab -e and add your cron job there. For example, to run a script every day at midnight, you would add:
- Backup Script:
- Create a script that performs the backup and exports it. Here’s a simple example:
- Running Commands as Admin:
- It seems like you're having trouble running commands as the admin user. Instead of using su - admin -c, you might need to log in as the admin user directly or use a different method to execute commands with the necessary permissions. For example, you can use the RESTCONF API for such tasks as told above by Nikoolayy [1].
- Troubleshooting:
- If your cron job isn’t working, try running the script manually to ensure it executes properly. Also, check the cron logs for any errors:
- Permissions:
- Ensure that the script has the correct permissions to be executed. You can set the executable permission using: bash chmod +x /path/to/your/backup_script.sh
If you continue to face issues, you might want to explore using the RESTCONF API for automating tasks on the F5 OS r-Series[1][2].
References[1] F5 OS r-Series cron job schedule | DevCentral
[2] Automate Tasks in F5 with Cron Jobs - NetMinion Solutions
- Cron Job Setup:
F5 seems to have added a cool new article Enabling automatic periodic backups on rSeries . F5OS cronjob something I think F5 is pushing away from being used as it was with tmos BIG-IP even when using the "root" account that has access to the Linux bash F5OS root user and bash access are local-only. Also even on normal BIG-IP I use icall as after upgrade the cronjobs are removed while icall stays but there seems to be no icall on F5OS at the moment, so I recommend following the F5 article.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com