[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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
>> helpful 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

	 
        


Reply to: