How to log all file that has been move,chmod,chown?
Hi All,
Seeking for your assistance on how to log that has been chmod,mv,chown,chgrp and how to prevent script running while chmod,mv,chown,chgrp are still running?
Ex: a/b/c-folder
what i did was(please see below). but it's not working. i ended up 0 bytes the .log
Expected output:
put all that commands that i used in the log file. and prevent the script from running again while the commands that i used are still running.
Please advise,
Thanks,
---------- Post updated at 07:10 PM ---------- Previous update was at 06:05 PM ----------
may i gently followed up on this please. i don't know how to start T_T
Please advise,
Thanks,
-nik
Last edited by nikki1200; 11-25-2013 at 07:25 AM..
Reason: Use code tags, please...
As per my understanding ,since these commands wont give any output, you are getting a zero byte file.
I believe you are looking for some kind of tracking to know what has happened with the files -- audit any changes made on the file.
I am not sure if there is any command that let us do this audit trail, but on googling i found the below link, may be you can take a look to get some idea,
This is confusing. Let's say you want to block access to /path/to/files, then find all the chmod (or created) and modified changes for the last 24 hours.
NOTE: blocking access to some directories, like I showed, is not needed and is dangerous and can actually hang the whole system or cause other important processes to fail. Therefore it is really a bad idea. Be very careful. I personally would not do that.
This User Gave Thanks to jim mcnamara For This Post:
Not sure the OP wants to block anything. I guess he/she wants to log actions performed. To do so, redirect stderr and not stdout, and append to the log file instead of overwriting. And, you may want to use the -v (verbose) options to the commands, if that exists. Like:
My git user has permission in sudoers to run a wrapper script to move files into my webroot.
Everything is working fine except for the chown line. After the script has run, the files ar still root:root instead of apache:apache.
Scratching my head...:confused:
#!/bin/sh
echo
echo "****... (4 Replies)
Hi,
I am logged in as super use and want to set owner of a root folder to a specific user.
#chown -R user1:group1 /u01
This gives the message:
chown: /u01: Read-only file system
chown: lost+found: Read-only file system
#ls -l
drwxr-xr-x 3 root system 256 Mar 21 16:42... (2 Replies)
does anyone know how to exclude a directory with chown or chmod?
im trying to do something like this
chown $username:$username $directory/*
chown $username:$username $directory/.*
chown $username:$username $directory
and
find $directory/* -type f -exec... (1 Reply)
Hi,
on a Solaris 5.9 machine no user except for root is able to use chown.
for exmaple:
> touch iamgal
> ls -la iamgal
-rw-r--r-- 1 galtest1 other 0 Dec 19 08:40 iamgal
> chown galu iamgal
chown: iamgal: Not owner
I have checked about /etc/system and rstchown - it is... (5 Replies)
Hi,
I have a typical problem. Consider the scenario:
Folder1
------> Folder2 ------> File1
------> Folder3
Above is my folder structure, currently the user group "other" has no permissions. I wish to give "read" permission for "others" to File1 using a single command.
chmod -R... (5 Replies)
I would like to chmod the file which I am pulling from remote server onto my server.
I am using the following script:
sftp <server detail>
get abc xyz
chmod 666 xyz
bye
Though I could fetch the file successfully but I am not able to change the permission of xyz file on my server.
umask... (1 Reply)
Hi!
I need help becouse I've server to backup and I've a lot of files with 700 permission and I need to change the mode to 755 before copy
So the point is. With find . -perm 700 -exec echo {} > textfile.txt \;
I got a text file with 3156 line which one... (3 Replies)
I'm changing (trying to anyway) a script that will need to unrar a file, this file will create a directory with files in it. Then I need to change the owner ship and permission on that directory. Finally, I will rsync the directory to another machine.
This is what I have so far.
#!/bin/bash
... (1 Reply)