# Rights problem at installatioin, delete cache, and some strange things over night

**URL:** <https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [April 13, 2024, 5:48am UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661 "2024-04-13T05:48:53Z")\
**Posts on this page:** 6\
**Page:** 2

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [April 15, 2024, 2:21pm UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/21 "2024-04-15T14:21:21Z")

</div>

Bad SysOp, obviously (me)

That variable needs to be the first one.

\*\* I updated the previous post to reflect the corrections. Please pay attention to the script (slight changes) and the dot-my.cnf files (was missing a [server] line in both)

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [April 15, 2024, 2:41pm UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/22 "2024-04-15T14:41:30Z")

</div>

```auto
#!/usr/bin/bash
source ~/.mautic.my.cnf
mkdir -p ~/backups/mautic/
mysqldump --defaults-file='~/.mautic.my.cnf' --single-transaction --add-drop-table $database | gzip > ~/backups/mautic/mautic-database-$(date +%Y%m%d-%H%M%S).sql>
find ~/backups/mautic -iname "mautic-database*" -mtime +30 -delete

```

brings that error:

```auto
stefan@mautic01:/usr/local/bin$ mautic_db_backup
/home/stefan/.mautic.my.cnf: line 1: [client]: command not found
/home/stefan/.mautic.my.cnf: line 5: [server]: command not found

```

.mautic.my.cnf

```auto
[client]
password="xxxxx"
user=mautic

[server]
database=mautic

```

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [April 15, 2024, 2:53pm UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/23 "2024-04-15T14:53:03Z")

</div>

Yes, execute it from the www-data user’s crontab. That is the best.

---

<div class="post-metadata">

**Author:** ![marcus42](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@marcus42](https://forum.mautic.org/u/marcus42)\
**Post date:** [April 15, 2024, 2:58pm UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/24 "2024-04-15T14:58:58Z")

</div>

I updated the previous post.

This error come from the fact that the dot-my.cnf file isn’t a proper bash script and contain invalid bash cmd. “source” is executing that file.

The goal was to execute the “database=blah” line and load a variable named “$database”. I later used it in the mysqldump line in order to declare the proper mysql schema.

You may disregard both errors or update your script with the updated one in the previous post. It will snooze both errors and get you peace of mind.

To demonstrate it, doing this will show you your expected results and that those 2 errors are harmless:  
`ls -latr ~/backups/mautic/`

---

<div class="post-metadata">

**Author:** ![stefan-franz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stefan-franz/32/12758_2.png) [@stefan-franz](https://forum.mautic.org/u/stefan-franz)\
**Post date:** [April 15, 2024, 4:09pm UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/25 "2024-04-15T16:09:41Z")

</div>

Dear @marcus42  
Thank you very much for your great support. Now all works. Great.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [April 17, 2024, 4:10am UTC](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661/26 "2024-04-17T04:10:37Z")

</div>

Closed on April 17, 2024, 4:10am UTC

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.

[Previous page](https://forum.mautic.org/t/rights-problem-at-installatioin-delete-cache-and-some-strange-things-over-night/31661.md?page=1)
