# \[Résolu\]erreur rsync sur /boot /etc /root !

**URL:** <https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673>\
**Category:** Support Debian\
**Created:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673 "2016-02-20T17:33:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris38](https://www.debian-fr.org/user_avatar/www.debian-fr.org/chris38/32/12918_2.png) [@chris38](https://www.debian-fr.org/u/chris38)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/1 "2016-02-20T17:33:50Z")

</div>

Bonjour,

Avec ce script :

[code]#! /bin/sh  
#Dossier de destination  
stockage="/home/chris/Save"

# Dossiers sytème

systeme=" /boot /etc /root"  
sleep 5  
rsync -acuzC --delete $systeme $stockage/save\_chris\_syst  
exit[/code]

j’ai cette erreur

```auto
.................
rsync: opendir "/root/.gnome2" failed: Permission denied (13)
rsync: opendir "/root/.synaptic" failed: Permission denied (13)
rsync: opendir "/root/.gconfd" failed: Permission denied (13)
rsync: send_files failed to open "/etc/.pwd.lock": Permission denied (13)
rsync: send_files failed to open "/etc/at.deny": Permission denied (13)
rsync: send_files failed to open "/etc/group-": Permission denied (13)
rsync: send_files failed to open "/etc/gshadow": Permission denied (13)
rsync: send_files failed to open "/etc/gshadow-": Permission denied (13)
rsync: send_files failed to open "/etc/passwd-": Permission denied (13)
rsync: send_files failed to open "/etc/shadow": Permission denied (13)
rsync: send_files failed to open "/etc/shadow-": Permission denied (13)
rsync: send_files failed to open "/etc/sudoers": Permission denied (13)
rsync: send_files failed to open "/etc/X11/Xwrapper.config": Permission denied (13)
rsync: send_files failed to open "/etc/apt/secring.gpg": Permission denied (13)
rsync: send_files failed to open "/etc/apt/trustdb.gpg": Permission denied (13)
rsync: send_files failed to open "/etc/cups/printers.conf": Permission denied (13)
rsync: send_files failed to open "/etc/mysql/debian.cnf": Permission denied (13)
rsync: send_files failed to open "/etc/phpmyadmin/htpasswd.setup": Permission denied (13)
rsync: send_files failed to open "/etc/ppp/chap-secrets": Permission denied (13)
rsync: send_files failed to open "/etc/ppp/pap-secrets": Permission denied (13)
rsync: send_files failed to open "/etc/security/opasswd": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_dsa_key": Permission denied (13)
rsync: send_files failed to open "/etc/ssh/ssh_host_rsa_key": Permission denied (13)
rsync: send_files failed to open "/root/.rnd": Permission denied (13)
...............
```

Je me suis planté ou encore ? sur les droits ?  
MERCI.

---

<div class="post-metadata">

**Author:** ![acid.g](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/a/e36b37/32.png) [@acid.g](https://www.debian-fr.org/u/acid.g)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/2 "2016-02-20T17:33:50Z")

</div>

Bonjour,

Petite question toute bête, sous quel user exécutes-tu ton script ?

@+

---

<div class="post-metadata">

**Author:** ![chris38](https://www.debian-fr.org/user_avatar/www.debian-fr.org/chris38/32/12918_2.png) [@chris38](https://www.debian-fr.org/u/chris38)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/3 "2016-02-20T17:33:51Z")

</div>

[quote=“acid.g”]Bonjour,

Petite question toute bête, sous quel user exécutes-tu ton script ?

@+[/quote]  
Pas sous root en tout les cas 😆 , mais comme je veux executer ce script dans une tache cron ❗ …

---

<div class="post-metadata">

**Author:** ![micky979](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@micky979](https://www.debian-fr.org/u/micky979)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/4 "2016-02-20T17:33:51Z")

</div>

Bonjour,

Si ce n’est pas execute en root, ca a peu de chance de marcher pour ces fichiers.

La raison :

`ll /etc/apt/*gpg -a
-rw------- 1 root root 0 nov 25 15:44 /etc/apt/secring.gpg
-rw------- 1 root root 1200 avr 18 05:14 /etc/apt/trustdb.gpg
-rw------- 1 root root 22457 avr 18 05:14 /etc/apt/trusted.gpg`

`ll /etc/at.deny 
-rw-r----- 1 root daemon 144 jan 3 2006 /etc/at.deny`

`ll /etc/passwd*
-rw-r--r-- 1 root root 1673 avr 29 22:29 /etc/passwd
-rw------- 1 root root 1654 avr 29 22:29 /etc/passwd-`

Soit tu exclus les fichiers appartenant seulement a root ou tu lance rsync en root.

@+

---

<div class="post-metadata">

**Author:** ![chris38](https://www.debian-fr.org/user_avatar/www.debian-fr.org/chris38/32/12918_2.png) [@chris38](https://www.debian-fr.org/u/chris38)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/5 "2016-02-20T17:33:52Z")

</div>

Je peux l’executer en root dans mon script ?

---

<div class="post-metadata">

**Author:** ![tukuyomi](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/t/73ab20/32.png) [@tukuyomi](https://www.debian-fr.org/u/tukuyomi)\
**Post date:** [Février 20, 2016, 5:33 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/6 "2016-02-20T17:33:55Z")

</div>

Tu peux le laisser comme ça et le mettre dans le cron du root, si tu y a accès

---

<div class="post-metadata">

**Author:** ![chris38](https://www.debian-fr.org/user_avatar/www.debian-fr.org/chris38/32/12918_2.png) [@chris38](https://www.debian-fr.org/u/chris38)\
**Post date:** [Février 20, 2016, 5:35 UTC](https://www.debian-fr.org/t/resolu-erreur-rsync-sur-boot-etc-root/13673/7 "2016-02-20T17:35:37Z")

</div>

C’est bon en passant par le cron “root”
