# Automatically update Searxng every 6 hours

**URL:** https://eijil.com/t/automatically-update-searxng-every-6-hours/453
**Category:** 其它
**Created:** [September 16, 2023, 1:08pm UTC](https://eijil.com/t/automatically-update-searxng-every-6-hours/453 "2023-09-16T13:08:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Tristan](https://eijil.com/user_avatar/eijil.com/tristan/32/986_2.png) [@Tristan](https://eijil.com/u/Tristan)
#### Post date: [September 16, 2023, 1:08pm UTC](https://eijil.com/t/automatically-update-searxng-every-6-hours/453/1 "2023-09-16T13:08:37Z")

</div>

**Searxng** gets updated very frequently, sometimes several times a day. Manually updating it can be tiring and cumbersome. This script below can **automatically update searxng**. Then in **crontab** , set it to run the update script every 6 hours.

Create a new file named updateSearxng.sh, and put the following content in it.

```bash
#!/bin/bash

# update searxng
cd /usr/local/searxng/searxng-src/

# Use echo command and pipe to auto input 2 and enter
echo "2" | sudo -H ./utils/searxng.sh instance update

# override searxng.png logo
cd /usr/local/searxng/searxng-src/searx/static/themes/simple/img
cp 3.png searxng.png

```

run `chmod +x updateSearxng.sh` to change the permission

run `crontab -e` and add the line  
`0 */6 * * * /root/updateSearxng.sh` .

The bash script will run every 6 hours.

for non-root users:

`nano visudo`  
add the following line to the end(suppose your user name is deploy):  
`deploy ALL=(ALL) NOPASSWD: /usr/local/searxng/searxng-src/utils/searxng.sh instance update`
