PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > backup script changes permissions
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

backup script changes permissions

Réponse
 
LinkBack Outils de la discussion
Vieux 06/04/2008, 12h40   #1
Haines Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut backup script changes permissions

I'be brought up my backup script for discussion before, and folks where
ful in solving a problem, but the solution created another. Now all
files backed up have their ownerships changed to me, brownh:brownh.

Here's the old script, which had the problem that output was going to a
mail message that quickly exceeded system limits, and then caused the
backup process to terminate:

find / -print | egrep -v "^/media|^/proc|^/sys|^/mnt" | cpio -pdmuv
/media/mirror/"$dirName" > 2>&1 | cat -vt

Here's the new script which only sends an error message:

find / -print | egrep -v "^/media|^/proc|^/sys" | cpio -pdmuv
/media/mirror/"$dirName" 2>&1 | cat -vT >/home/brownh/.backup.log

However, it seems to convert ownership of all files backed up to
brownh:brownh.

--

Haines Brown, KB1GRM





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 13h20   #2
Kevin Mark
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

On Sun, Apr 06, 2008 at 07:28:51AM -0400, Haines Brown wrote:
> I'be brought up my backup script for discussion before, and folks where
> ful in solving a problem, but the solution created another. Now all
> files backed up have their ownerships changed to me, brownh:brownh.
>
> Here's the old script, which had the problem that output was going to a
> mail message that quickly exceeded system limits, and then caused the
> backup process to terminate:
>
> find / -print | egrep -v "^/media|^/proc|^/sys|^/mnt" | cpio -pdmuv
> /media/mirror/"$dirName" > 2>&1 | cat -vt
>
> Here's the new script which only sends an error message:
>
> find / -print | egrep -v "^/media|^/proc|^/sys" | cpio -pdmuv
> /media/mirror/"$dirName" 2>&1 | cat -vT >/home/brownh/.backup.log
>
> However, it seems to convert ownership of all files backed up to
> brownh:brownh.
>
> --


I did:
cpio --

and the only thing that stuck out was this option:
--no-preserve-owner Do not change the ownership of the files

so maybe add this and use:
cpio -pdmuv --no-preserve-owner

hth,
K
--
| .''`. == Debian GNU/Linux == | my web site: |
| : :' : The Universal |mysite.verizon.net/kevin.mark/|
| `. `' Operating System | go to counter.li.org and |
| `- http://www.debian.org/ | be counted! #238656 |
| my keyserver: subkeys.pgp.net | my NPO: cfsg.org |
|join the new debian-community.org to Debian! |
|_______ Unless I ask to be CCd, assume I am subscribed _______|


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 13h40   #3
Osamu Aoki
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

On Sun, Apr 06, 2008 at 07:28:51AM -0400, Haines Brown wrote:
> I'be brought up my backup script for discussion before, and folks where
> ful in solving a problem, but the solution created another.


I did not read it...

> Now all
> files backed up have their ownerships changed to me, brownh:brownh.
>
> Here's the old script, which had the problem that output was going to a
> mail message that quickly exceeded system limits, and then caused the
> backup process to terminate:


Is this cron script? Why "mail"?

> find / -print | egrep -v "^/media|^/proc|^/sys|^/mnt" | cpio -pdmuv
> /media/mirror/"$dirName" > 2>&1 | cat -vt


I do not understand first ">"

> Here's the new script which only sends an error message:
>
> find / -print | egrep -v "^/media|^/proc|^/sys" | cpio -pdmuv
> /media/mirror/"$dirName" 2>&1 | cat -vT >/home/brownh/.backup.log
>
> However, it seems to convert ownership of all files backed up to
> brownh:brownh.
>From what account did you run this/

* root from real root
* root from sudo
* account brownh

If last, files are owned by brownh. That is how it sould be.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 14h40   #4
Noah Slater
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

On Sun, Apr 06, 2008 at 07:28:51AM -0400, Haines Brown wrote:
> I'be brought up my backup script for discussion before, and folks where
> ful in solving a problem, but the solution created another. Now all
> files backed up have their ownerships changed to me, brownh:brownh.


Why don't you use a prebuilt package such as backup2l?

--
Noah Slater <http://bytesexual.org/>


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 15h50   #5
Haines Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

Kevin Mark <kevin.mark@verizon.net> writes:

> On Sun, Apr 06, 2008 at 07:28:51AM -0400, Haines Brown wrote:
>> I'be brought up my backup script for discussion before, and folks where
>> ful in solving a problem, but the solution created another. Now all
>> files backed up have their ownerships changed to me, brownh:brownh.


> I did:
> cpio --
>
> and the only thing that stuck out was this option:
> --no-preserve-owner Do not change the ownership of the files
>
> so maybe add this and use:
> cpio -pdmuv --no-preserve-owner


I'll give that a try. The logic of the option escaped me. It says,
"leave [files] owned by the user extracting them. This is the default of
non-root users".

In the past, if I ran my backup script as root (sudo), I didn't have
ownership change, and when cron ran it there was no change either,
although I did have other problems, which is why I messed with the
script. It had been running for years without any problem, until I
upgraded to etch.

I assume the "user" here is cron, but then does not this option say
leave the files owned by cron? Made no sense to me. Didn't sound like it
was something I wanted to do.
--

Haines Brown, KB1GRM





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 16h10   #6
Haines Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

Osamu Aoki <osamu@debian.org> writes:

> On Sun, Apr 06, 2008 at 07:28:51AM -0400, Haines Brown wrote:
>> I'be brought up my backup script for discussion before, and folks where
>> ful in solving a problem, but the solution created another.

>
> I did not read it...


In brief, I was directing stdout and stderr to: > 2>&1, and this by
default creates a message, and when the message size limit was reached,
it stopped the process.

What I have is a script in ~/scripts that is known to my private cron
db: ~/cron-brownh, which in turn is known to /etc/cron.weekly.

>> find / -print | egrep -v "^/media|^/proc|^/sys|^/mnt" | cpio -pdmuv
>> /media/mirror/"$dirName" > 2>&1 | cat -vt

>
> I do not understand first ">"


"First" >? Just one that I can see. Or do you mean in the first script?
My answer: I forget. In any case, it worked fine when run directly by
root (sudo).

>> Here's the new script which only sends an error message:
>>
>> find / -print | egrep -v "^/media|^/proc|^/sys" | cpio -pdmuv
>> /media/mirror/"$dirName" 2>&1 | cat -vT >/home/brownh/.backup.log
>>
>> However, it seems to convert ownership of all files backed up to
>> brownh:brownh.
>>From what account did you run this/


> * root from real root
> * root from sudo
> * account brownh
>
> If last, files are owned by brownh. That is how it sould be.


Well, I really don't know ;-(. I merged my private cron-brownh database,
and so it would be run by cron, which is owned by root. In my
~/cron-brownh (owned by brownh:brownh) is the line:

0 4 * * 0 /home/brownh/scripts/backup

--

Haines Brown, KB1GRM





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 16h10   #7
Haines Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

Noah Slater <nslater@bytesexual.org> writes:

> Why don't you use a prebuilt package such as backup2l?


Noah, I might just do that. I've spent a lot of time struggling with the
backup script, which only offered the advantage of having unarchived files,
but in recent years I've not found it as necessary to recover single
files as I used to, and doing so does not seem at all difficult with
backup2l. I'm giving it a look.
--

Haines Brown, KB1GRM





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 06/04/2008, 16h40   #8
Owen Townend
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: backup script changes permissions

On 07/04/2008, Haines Brown <brownh@hartford-hwp.com> wrote:
>
> Noah Slater <nslater@bytesexual.org> writes:
>
> > Why don't you use a prebuilt package such as backup2l?

>
>
> Noah, I might just do that. I've spent a lot of time struggling with the
> backup script, which only offered the advantage of having unarchived
> files,
> but in recent years I've not found it as necessary to recover single
> files as I used to, and doing so does not seem at all difficult with
> backup2l. I'm giving it a look.
>
> --
>
> Haines Brown, KB1GRM



Hey,
There are other options around too such as local rsync. Something like
this should work similarly:
rsync -avh --exclude=/media --exclude=/proc --exclude=/sys /
/media/mirror/${dirName}/ 2>&1 | cat -vT > /home/brownh/.backup.log

cheers,
Owen.

--
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h59.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18182 seconds with 16 queries