Sponsored Content
Top Forums UNIX for Beginners Questions & Answers [Tip] Housekeeping Tasks Made Easy - User Home directories and Leftover Files Post 303037241 by MadeInGermany on Friday 26th of July 2019 02:53:24 PM
Old 07-26-2019
I once had two scripts for our customer:
1. scanning "unowned" homedirs for recently accessed files. If nothing found, delete. If something found, display it and stop the search - and do not delete.
2. scanning shared project directories in "deepest first fashion" (find -depth), and assign each "unowned" directory to the owner of its parent directory.
This User Gave Thanks to MadeInGermany For This Post:
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Batch delete specific folder from user home directories

Hi! Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server? Example: The userdata are stored on a Xsan Volume like this: /Volumes/Xsan/userdata/mike /Volumes/Xsan/userdata/peter... (2 Replies)
Discussion started by: nipodrom
2 Replies

2. Shell Programming and Scripting

How to verify all user home directories are writable only by their owner

Hi, I'm currently working on my school assignment on how to verify that all user home directories are writable only by their owner on Solaris with VMware. But I'm not sure why my codes take a very long time to display the results. My friend says it's the `su - $i -c "ls -ld" 2> /dev/null | grep... (1 Reply)
Discussion started by: NuuBe
1 Replies

3. Homework & Coursework Questions

How to verify all user home directories are writable only by their owner

1. The problem statement, all variables and given/known data: Need to verify that all user home directories are writable only by their owner on Solaris. The script posted below is workable but it is taking a long time to display the results, and I don't seem to be able to fix it or find any... (6 Replies)
Discussion started by: NuuBe
6 Replies

4. Homework & Coursework Questions

i made this tasks. and i need some explenation or just remake my code.

Hello i hope this post is ok! and i hope that i get the point of rules :) i made this tasks by my self but few of them arent working.. and i dont know why!? u think u could help me? to give me some reasons why dont they work.. and remake my code that will work? hope to get answer soon! ... (9 Replies)
Discussion started by: eclip
9 Replies

5. Solaris

How to unmount user home directories ??

I've allocated /exports for all user directories by making separate directories under /exports..... :rolleyes: now i need to unmount /exports . But i'm unable to do that.. How can i troubleshoot this issue. Thanks in advance:D (2 Replies)
Discussion started by: vamshigvk475
2 Replies

6. UNIX for Dummies Questions & Answers

New user to own files made by root?

Hi, when I installed debian 8, all files are created and owned by root, when I add new user, for example marco, he can't create directory or change files created by root. I tried with ftp, permission denied. so, I am interested how to grant to user marco ownership of all files in the system so... (5 Replies)
Discussion started by: alanford
5 Replies
removeuser(8)						      System Manager's Manual						     removeuser(8)

NAME
removeuser - Deletes user accounts interactively SYNOPSIS
/usr/sbin/removeuser DESCRIPTION
Security Note If you have enhanced security installed on your system, you should use the dxaccounts command to remove users. See the Security manual and the dxaccounts(8) reference page for more information. The removeuser command is an interactive command for deleting user accounts from your system. It also gives the option of deleting the user's home directory, files and mail. The command prompts you for specific information and informs you of its activity and error condi- tions. The removeuser command invokes /usr/sbin/userdel to delete the user account information from /etc/passwd and the hashed password database (if present). Only the superuser can execute this command. The command performs the following tasks: Asks for a login name for the user to be deleted. Enter the login name. If this entry does not exist in the /etc/passwd file, the command informs you of this and exits. If the entry does exist, the command continues. Displays the entry for the user from the /etc/passwd file and asks if this is the entry you want to delete. If the answer to this query is no, the com- mand indicates that the user was not deleted and then exits. If the answer to this query is yes, the command deletes the user's entry from the /etc/passwd file and any occurrences of the user from the /etc/group file. It then states that the user was deleted. Searches several administrative directories and files for occurrences of the user and informs you if they exist. If so, it suggests that you may want to delete these occurrences when the command is finished. If no occurrences of the user are found in these directories and files, the command indicates so. Asks if you want to delete the home directory, all subdirectories, and all mail files for the user. If the answer to this query is no, the command indicates that the user's home directory was not deleted and then exits. If the answer to this query is yes, the command continues. As a precaution, the command reminds you that you should have backed up the files for the user before removing them if you do not want to lose them. It then asks if you are sure that you want to delete the files for this user. If the answer to this query is no, the command indicates that the user's home directory was not deleted and then exits. If the answer to this query is yes, the command states that it is removing the user's home directory, its contents and the user's mail file. It then deletes these items. At this point, the command ends. NOTES
Users are advised to migrate to the /usr/sbin/userdel utility or the dxaccounts utility as this command may be removed in a future version of the operating system. EXAMPLES
Enter a login name to be removed or <Return> to exit: john This is the entry for (john) in the /etc/passwd file: john:VSh6/xbMqPDcY:5006:15:sdf:/usr/users/john: Is this the entry you want to delete (y/n)? y Working ... Entry for (john) removed. Searching relevant directories and files for (john) ... None found. Do you want to remove the home directory, all subdirectories, files, and mail for (john) (y/n)? y The files for (john) will be lost if not backed up. Are you sure you want to remove these files (y/n)? y Deleting /usr/users/john Deleting /usr/spool/mail/john FILES
Specifies the command path Group file Password file SEE ALSO
Commands: addgroup(8), adduser(8), dxaccounts(8), finger(1), mkpasswd(8), passwd(1), useradd(8), userdel(8), vipw(8) Files: group(4), passwd(4) removeuser(8)
All times are GMT -4. The time now is 03:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy