Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copy and modify a file if the original has changed Post 302826977 by alister on Thursday 27th of June 2013 04:37:16 PM
Old 06-27-2013
If you only need to run the job on Linux, perhaps you can use inotifywait to listen for file creation and modification, solving both problems.

Regards,
Alister
 

10 More Discussions You Might Find Interesting

1. AIX

way to copy only changed files

Hello, we are going through a restructoring of file systems and will need to copy the contents of one file system to another box, then a few days later copy it again. Is there a way on the second copy to only copy files that have changed? Thanks in advance (3 Replies)
Discussion started by: zuessh
3 Replies

2. Shell Programming and Scripting

Trying to Copy Files Changed Recently

I have been toying around with a script that will copy all files altered in a development directory over to a testing directory and have been trying to construct the command to meet my needs. Basically I am using find in a directory to see what files have changed over the past 24 hours. Then if... (4 Replies)
Discussion started by: scotbuff
4 Replies

3. UNIX for Advanced & Expert Users

command to copy files with original ownership

Hi, I need a command that to copy files from others and to keep files' ownership. Example: I copy file.txt from users "abc" to my local, and file.txt is own by user "abc" in local. Thanks in advance! (3 Replies)
Discussion started by: need_help
3 Replies

4. UNIX for Dummies Questions & Answers

Where can I get original copy of Unices

BSD, AFAIK, Linux, etc are developed/based upon UNIX... but they are not UNIX... I'm wandering where can I obtain a original copy of UNIX(without flavor) (1 Reply)
Discussion started by: laduch
1 Replies

5. Shell Programming and Scripting

Help with a shell script to modify one line and copy the next 9 to same file

Hi everyone, the problem is quite simple, yet I can't find an easy solution using awk. I need to search for a string in $3, then if I find this string, copy the line,modify $3, and copy the next 9 lines to the same file. My problem is in the copying of the lines... Finding and modifying... (5 Replies)
Discussion started by: Teroc
5 Replies

6. UNIX for Dummies Questions & Answers

how to copy files and record original file location?

:EDIT: I think my post name should have been labeled: how to copy files and record original file location. not "retain". Hello, this is my first post! I searched the forums a lot before posting, but was unable to answer my question. Here's my problem: There are several hundred text files... (4 Replies)
Discussion started by: willie8605
4 Replies

7. Shell Programming and Scripting

command to copy original files from links in HP-UX

I have folder ABC and files in ABC are links. I want to create the same ABC folder in different path and copy the actual files from source ABC dir. Can anyone provide command for this? Thanks in advance. (2 Replies)
Discussion started by: venkatababu
2 Replies

8. UNIX for Advanced & Expert Users

copy original files from links

I have folder ABC and files in ABC are links. I want to create the same ABC folder in different path and copy the actual files from source ABC dir. Can anyone provide HP-UX command for this? note: cp -L is not working in HP-UX Thanks in advance. (1 Reply)
Discussion started by: venkatababu
1 Replies

9. Shell Programming and Scripting

Script to echo "File permissions or ownership changed from required " when accidentally changed.

Hi All, I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :( which have similar names ( /var in root and var of some other directory ).:confused: Can some one suggest me with the... (1 Reply)
Discussion started by: shiek.kaleem
1 Replies

10. Shell Programming and Scripting

Make a copy of a file when someone tries to modify the file

I wish to take a backup of the file when someone tries to modify a file say /tmp/test.txt using vi, vim, cat, copy, mv commands. I'm aware of inotify which will notify me of any changes to the file however, I wish to make a backup before and not after the changes are made to the file. I... (1 Reply)
Discussion started by: mohtashims
1 Replies
USERMOD(8)						    BSD System Manager's Manual 						USERMOD(8)

NAME
usermod -- modify user login information SYNOPSIS
usermod [-FmoSv] [-C yes/no] [-c comment] [-d home-dir] [-e expiry-time] [-f inactive-time] [-G secondary-group] [-g gid | name | =uid] [-L login-class] [-l new-login] [-p password] [-s shell] [-u uid] user DESCRIPTION
The usermod utility modifies user login information on the system. Default values are taken from the information provided in the /etc/usermgmt.conf file, which, if running as root, is created using the built- in defaults if it does not exist. See user(8) for more information about EXTENSIONS. After setting any defaults, and then reading values from /etc/usermgmt.conf, the following command line options are processed: -C yes/no Enable user accounts to be temporary locked/closed. The yes/no operand can be given as ``yes'' to lock the account or ``no'' to unlock the account. -c comment Set the comment field (also, for historical reasons known as the GECOS field) for the user. The comment field will typically include the user's full name and, perhaps, contact information for the user. -d home-directory Set the home directory without populating it; if the -m option is specified, tries to move the old home directory to home-directory. -e expiry-time Set the time at which the account expires. This can be used to implement password aging. It should be entered in the form ``month day year'', where month is the month name (the first three characters are sufficient), day is the day of the month, and year is the year. Time in seconds since the epoch (UTC) is also valid. A value of 0 can be used to disable this feature. This value can be preset for all users using the expire field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -F Force the user to change their password upon next login. -f inactive-time Set the time at which the password expires. See the -e option. -G secondary-group Specify a secondary group to which the user will be added in the /etc/group file. The secondary-group may be a comma-delimited list for multiple groups. Or the option may be repeated for multiple groups. (16 groups maximum.) -g gid | name | =uid Give the group name or identifier to be used for the user's primary group. If this is '=uid', then a uid and gid will be picked which are both unique and the same, and a line will be added to /etc/group to describe the new group. This value can be preset for all users by using the group field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -L login-class Set the login class for the user. See login.conf(5) for more information on user login classes. This value can be preset for all users by using the class field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. This option is included if built with EXTENSIONS. -l new-user Give the new user name. It can consist of alphanumeric characters and the characters '.', '-', and '_'. -m Move the home directory from its old position to the new one. If -d is not specified, the new-user argument of the -l option is used; one of -d and -l is needed. -o Allow duplicate uids to be given. -p password Specify an already-encrypted password for the user. This password can then be changed by using the chpass(1) utility. This value can be preset for all users by using the password field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. This option is included if built with EXTENSIONS. -S Allow samba user names with a trailing dollar sign to be modified. This option is included if built with EXTENSIONS. -s shell Specify the login shell for the user. This value can be preset for all users by using the shell field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -u uid Specify a new uid for the user. Boundaries for this value can be preset for all users by using the range field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -v Enable verbose mode - explain the commands as they are executed. This option is included if built with EXTENSIONS. Once the information has been verified, usermod uses pwd_mkdb(8) to update the user database. This is run in the background. At very large sites this can take several minutes. Until this update is completed, the password file is unavailable for other updates and the new informa- tion is not available to programs. EXIT STATUS
The usermod utility exits 0 on success, and >0 if an error occurs. FILES
/etc/usermgmt.conf SEE ALSO
chpass(1), group(5), passwd(5), usermgmt.conf(5), pwd_mkdb(8), user(8), useradd(8), userdel(8) HISTORY
The usermod utility first appeared in NetBSD 1.5. It is based on the addnerd package by the same author. AUTHORS
The usermod utility was written by Alistair G. Crooks <agc@NetBSD.org>. BSD
January 13, 2009 BSD
All times are GMT -4. The time now is 02:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy