coreutils
[Top][All Lists]
Advanced

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

chown new option


From: Maxsuel Marcelino
Subject: chown new option
Date: Fri, 27 May 2022 09:41:36 -0300

chown needs and a new option:

An option that allows you to change only the contents of directories
and not directories and subdirectories.

After the end of the day I need "user 1" to be able to read and add
files, but NOT delete after 5pm. note: that the contents of some
folders cannot be deleted; however the directory can receive new
files.

For that I created the following script:

############################### script ###########################

###Actual structure of folders### -->
/LVM/MONITORAMENTO/CARROS/CARRO-11897/2022/MAIO/DIA
27/Data/00001610.ub1

###variable###
DATA=`date +/%Y/%^B/DIA `

###commands###
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-381*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-380*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-379*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-378*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-377*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-376*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-11899*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-11898*/$DATA*/*/*
chown root:root -v  /LVM/MONITORAMENTO/CARROS/CARRO-11897*/$DATA*/*/*

############################## end of script #########################

Everything would be simplified if [chwon] had an (option) that ignores
directories and sub-directories, reaching only the files.

Example: The command line would be reduced to just one line. Ex:
chown root:root -v -(new option)  /LVM/MONITORAMENTO/CARROS/CARRO-*

Observation:
(new option) = contents of directories (files) only


Maxsuel Marcelino
Brasil
Maxzuel@GmaiL.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]