# Schedule automatic UCS F5 backup

**URL:** <https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146>\
**Category:** Technical Forums\
**Tags:** application-delivery\
**Created:** [September 25, 2023, 1:53pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146 "2023-09-25T13:53:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Preet\_pk](https://avatars.discourse-cdn.com/v4/letter/p/a698b9/32.png) [@Preet\_pk](https://community.f5.com/u/Preet_pk)\
**Post date:** [September 25, 2023, 1:53pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/1 "2023-09-25T13:53:33Z")

</div>

Hi,

I want to auto schedule F5 UCS backup. Please share the steps to configure scheduled auto backup in F5.

---

<div class="post-metadata">

**Author:** ![Paulius](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/paulius/32/21698_2.png) [@Paulius](https://community.f5.com/u/Paulius)\
**Post date:** [September 25, 2023, 2:36pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/2 "2023-09-25T14:36:15Z")

</div>

@Preet_pk This is what you are looking for I believe.

[https://community.f5.com/t5/codeshare/f5-iapp-automated-backup/ta-p/288311](https://community.f5.com/topic/288311)

---

<div class="post-metadata">

**Author:** ![ScottE](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/scotte/32/11894_2.png) [@ScottE](https://community.f5.com/u/ScottE)\
**Post date:** [September 25, 2023, 2:45pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/3 "2023-09-25T14:45:17Z")

</div>

Hello,

What I do nightly (via cron) is create a UCS backup file and then send my backup to a remote file server.&nbsp; I have a couple of devices so I make the UCS backup file have the name of the device.

backup\_config.sh

```auto
#/bin/sh<br><br>HOST=`echo $HOSTNAME | awk -F . '{print $1}'`<br>CONFILE=`echo /shared/tmp/$HOST.ucs`<br>tmsh -c "save sys ucs $CONFILE"<br>/usr/bin/scp $CONFILE <username>@<IP of backup server>:/<backup_directory>

```

crontab

```auto
35 23 * * * /root/backup.sh 2>&1 > /dev/null

```

Normally the UCS file is written to /var/local/ucs but my config files are large so there is not always room in that directory so I write them to /shared/tmp instead.&nbsp; If your configs are smaller you would not need to do that.&nbsp; If they are small and you want to keep multiple on box then I would add a date to the filename in the script above but then you will also have to prune them after your retention date.

There is more in my backup script to send copies of other files for off box retention and adding them to our Rancid repository.

Please note if you add this to the root crontab then you will have to re-add it each time you upgrade since the upgrade overwrites the root crontab file.

---

<div class="post-metadata">

**Author:** ![Nikoolayy1](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/nikoolayy1/32/3589_2.png) [@Nikoolayy1](https://community.f5.com/u/Nikoolayy1)\
**Post date:** [September 25, 2023, 4:24pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/4 "2023-09-25T16:24:53Z")

</div>

That is a great solution but for the scheduling better use icall than cronjob as it will stay there even after tmos upgrade.

[https://community.f5.com/t5/technical-articles/what-is-icall/ta-p/288206](https://community.f5.com/topic/288206)

---

<div class="post-metadata">

**Author:** ![ScottE](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/scotte/32/11894_2.png) [@ScottE](https://community.f5.com/u/ScottE)\
**Post date:** [September 25, 2023, 5:45pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/5 "2023-09-25T17:45:13Z")

</div>

@Nikoolayy1 &nbsp; Thanks for the tip.&nbsp; I have just converted my backup process from cron to icall.

---

<div class="post-metadata">

**Author:** ![boneyard](https://d1p9zq3aats0t8.cloudfront.net/user_avatar/community.f5.com/boneyard/32/20419_2.png) [@boneyard](https://community.f5.com/u/boneyard)\
**Post date:** [October 1, 2023, 4:04pm UTC](https://community.f5.com/t/schedule-automatic-ucs-f5-backup/73146/6 "2023-10-01T16:04:17Z")

</div>

has your question been answered @Preet_pk ? if so please flag the answer that helped you?
