[LUGOS] Scripta za backup

Dalibor lugos at ice.si
Mon Sep 20 12:40:46 CEST 2004


Gregor GORJANC wrote:

> ali še bolje
>
> USERS="bedanec kekec rozle pehta mojca"
>
> for USER in $USERS; do
>
>    karkoli pač že
>
> done
>
> Matjaz Terpin wrote:
>
>> Dalibor wrote:
>>
>>> Rad bi backupiral /home dir vendar pa backup skripta ne bi  zajela 
>>> vseh userjev v /home dir. Npr imam 10 userjev in samo petim bi delal 
>>> backup. Kako naj rešim ta problem? Ne mislim pa ponavljati kode za 
>>> vsakega userja posebej. Ali se ta problem reši s kakšno for zanko?
>>>
>>> V skripti imam:
>>>
>>> echo "  Copying /home ..."
>>> cd $backup_loc
>>> cp -dpR /home/ $backup_loc
>>> echo "done copying !!!"
>>
>>
>>
>> Približno tako:
>>
>> for u in janko metka coprnica ; do
>>    mkdir $backup_loc/$u
>>    cp -dpR /home/$u $backup_loc/$u
>> done
>>
>>
>> LP!
>>
>>       Matjaž
>>
>>
>>
>
Hvala, prav to sem rabil.



More information about the lugos-list mailing list