1

I use automysqlbackup to backup my mysql database.

The problem is I can only run this program using sudo automysqlbackup. This program dumps the backup into my folder /home/user/backup but theses files are owned by root and when I connect via ftp to this folder I cannot delete or read them.

Is it possible that any files created by root in the folder /home/user/backup can be read/write/deleted by user "user" ?

Or is there a way I can run the automysqlbackup with user "user" ?

2 Answers 2

1

Couldn't write a bash script, which calls the backup and then changes the permissions with chmod ?

Sign up to request clarification or add additional context in comments.

2 Comments

i could but i'm relative new to linux .. Isnt there an easier way ?
Finnaly, I used a bash script as you noticed
0

For the first question : you can use SUID, for example :

chmod 4750 file1.txt 

Here in 4750, 4 indicates SUID bit set, 7 for full permissions for owner, 5 for read and execute permissions for group, and no permissions for others.

For example, you can chmod your command, and your user may execute your backup command

For the second question, you can upgrade the user rights with the file /etc/sudoers.

If you need more help, say me.

3 Comments

In case the link goes down (which does happen occasionally), could you please edit your answer to include a summary of how to use the SUID from the link?
could you provide me an example for my case with SUID ?
I Updated my first post

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.