# Update mirror cron job on admin/monitor page...how's that done?

**URL:** <https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759>\
**Category:** General\
**Created:** [December 7, 2018, 12:48am UTC](https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759 "2018-12-07T00:48:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkebler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dkebler/32/333_2.png) [@dkebler](https://forum.gitea.com/u/dkebler)\
**Post date:** [December 7, 2018, 12:48am UTC](https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759/1 "2018-12-07T00:48:34Z")

</div>

I’m fairly new to gitea.

I have two gitea instances running one locally and one remotely. I’d like to mirror local to remote in order to have an offsite backup.

Poking around I see in the admin/monitor page a list of running cron jobs one being “update mirrors” every 10 minutes. How does one implement that?? What/where is the code/script being run by that cron job?

I can find no documentation on the “feature”. I did find one other related post

> [@\[solved\] Automated mirroring of Gitea to Gitea](https://forum.gitea.com/t/automated-mirroring-of-gitea-to-gitea/717):
>
> There are github issues about mirroring from github and gitlab etc into gitea, but I’ve not yet seen anyone talk about automated mirroring of one gitea instance to another. My personal use case is mirroring my main remote gitea instance repos to repos running on my home server. So far I’ve been setting up a mirror on the my home server manually for each new repo I create on the remote. But that’s tedious…and I’ve gotten a bit behind. It looks like most of the required features already exist in…

---

<div class="post-metadata">

**Author:** ![adrinux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/adrinux/32/4741_2.png) [@adrinux](https://forum.gitea.com/u/adrinux)\
**Post date:** [December 7, 2018, 11:56am UTC](https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759/2 "2018-12-07T11:56:03Z")

</div>

Yes, you want to do the same thing as me 🙂  
Currently you cant just point the local to the remote and have it magically mirror everything - which is what I was asking about in the other post.

What you can do is set up individual repositories as mirrors (of your remote gitea, github or wherever) and those mirrors will automatically be kept in sync, it’s those sync tasks you’re seeing in the admin/monitor section.

To set up a mirror add a new ‘migration’ and make sure you check the ‘migration type’ box to say it’s a mirror.

---

<div class="post-metadata">

**Author:** ![dkebler](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/dkebler/32/333_2.png) [@dkebler](https://forum.gitea.com/u/dkebler)\
**Post date:** [December 7, 2018, 9:27pm UTC](https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759/3 "2018-12-07T21:27:50Z")

</div>

hmmm. looking at a repo in ui I want to mirror I see no place to add a “migration” so not sure what you are referring to??

Alternatively I can set up a post-receive hook  
here’s an issue where someone just set up a post-receive hook for each repo

> <https://github.com/go-gitea/gitea/issues/3480#issuecomment-370137911>

  
the only question is how does one generate a token in gitea for command line git push authorization?

---

<div class="post-metadata">

**Author:** ![adrinux](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/adrinux/32/4741_2.png) [@adrinux](https://forum.gitea.com/u/adrinux)\
**Post date:** [December 7, 2018, 11:09pm UTC](https://forum.gitea.com/t/update-mirror-cron-job-on-admin-monitor-page-hows-that-done/759/4 "2018-12-07T23:09:04Z")

</div>

This is not something you do from an existing repo. You’re creating a new repo and setting it as a mirror.

So you have an existing remote repo. You log into the local gitea, click the the + button on the right side of the header and choose New migration. Within the form that shows there is a checkbox next to migration type.
