Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to log all file that has been move,chmod,chown? Post 302876488 by nikki1200 on Monday 25th of November 2013 06:10:17 AM
Old 11-25-2013
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
Code:
file1.txt
file2.txt
file3.txt

Code:
chmod 777 *
chown owner
owner group
mv

what i did was(please see below). but it's not working. i ended up 0 bytes the .log
Code:
chmod 777 * > test.log
chown owner > test.log
mv * > test.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.

Code:
Move command expected output sample
a/ - folder
file1.txt is transferred to a/ folder
file2.txt is transferred to a/ folder

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

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trying to untar then chown, and chmod

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)
Discussion started by: walkerl
1 Replies

2. Shell Programming and Scripting

use a file to chmod

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)
Discussion started by: ruben.rodrigues
3 Replies

3. UNIX for Dummies Questions & Answers

chmod of remote file

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)
Discussion started by: kdtrica
1 Replies

4. Shell Programming and Scripting

File permission by chmod

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)
Discussion started by: animesh303
5 Replies

5. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

6. UNIX for Dummies Questions & Answers

chown: <file>: Not owner on Solaris 9

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)
Discussion started by: galuzan
5 Replies

7. Shell Programming and Scripting

excluding a directory with chown, chmod

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)
Discussion started by: vanessafan99
1 Replies

8. UNIX for Dummies Questions & Answers

chown: Read-only file system

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)
Discussion started by: shoefiend
2 Replies

9. Shell Programming and Scripting

Chmod working in sudo run script but chown isn't

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)
Discussion started by: dheian
4 Replies
CHGRP(1)						    BSD General Commands Manual 						  CHGRP(1)

NAME
chgrp -- change group SYNOPSIS
chgrp [-R [-H | -L | -P]] [-fhv] group file ... DESCRIPTION
The chgrp utility sets the group ID of the file named by each file operand to the group ID specified by the group operand. Options: -H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are not followed.) -L If the -R option is specified, all symbolic links are followed. -P If the -R option is specified, no symbolic links are followed. -R Change the group ID for the file hierarchies rooted in the files instead of just the files themselves. -f The force option ignores errors, except for usage errors and doesn't query about strange modes (unless the user does not have proper permissions). -h If file is a symbolic link, the group of the link is changed. -v Cause chgrp to be verbose, showing files as they are processed. If -h is not given, unless the -H or -L option is set, chgrp on a symbolic link always succeeds and has no effect. The -H, -L and -P options are ignored unless the -R option is specified. In addition, these options override each other and the command's actions are determined by the last one specified. The group operand can be either a group name from the group database, or a numeric group ID. Since it is valid to have a group name that is numeric (and doesn't have the numeric ID that matches its name) the name lookup is always done first. Preceding the ID with a ``#'' charac- ter will force it to be taken as a number. The user invoking chgrp must belong to the specified group and be the owner of the file, or be the super-user. Unless invoked by the super-user, chgrp clears the set-user-id and set-group-id bits on a file to prevent accidental or mischievous creation of set-user-id or set-group-id programs. The chgrp utility exits 0 on success, and >0 if an error occurs. FILES
/etc/group Group ID file SEE ALSO
chown(2), lchown(2), fts(3), group(5), passwd(5), symlink(7), chown(8) STANDARDS
The chgrp utility is expected to be POSIX 1003.2 compatible. The -v option and the use of ``#'' to force a numeric group ID are extensions to IEEE Std 1003.2 (``POSIX.2''). BSD
September 25, 2003 BSD
All times are GMT -4. The time now is 01:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy