This should work in newer bash and ksh.
Additional error handling should be done against utilities used against accounts.
Hope that helps
Regards
Peasant.
hi ,
I need to know commands to be used in the script to invoke batches in order from other scripts and then run those batches,and how to take those logs of those batches which fails........If anyone give me a better idea to complete this entire task in a single script... (5 Replies)
Hi there,
I need sh script to create a backup per domain and then ftp each file
to different host.
let's say I have bunch of domains in /var/www/vhosts/
so when sh will be executed it will create something like
domain.com.tar.gz
domain2.tar.gz
Can somebody help?
Thank you, Dmitry (0 Replies)
Hello,
I'm Have 1 Question abut
if i need to run another script in my bash script by example
/scripts/killacct this script for cpanel but when i try to execute this command
/scripts/killacct username he ask me yes or no any idea to answer on this question with yes in my bash script
I'm... (2 Replies)
Hi all,
I would need a rather simple bash backup script that loops throught the (local) users and for each users backs up (cp!) its /home/username folder.
About the functionalities:
The script has to run every 2 hours (that's cron, so don't mind about that) and the files should be copied to... (12 Replies)
Hi
I have a script that performs a process on a file.
I want to know how to include a function to run a batch of files?
Here is my script
#!/bin/bash
#----------------------------------------------------------------------------------------------------------------------
#This... (2 Replies)
Basically it's for a work assignment.
Have to make a menu with the following choices
***************menu*********************
1) Show Current Directory
2) Dispaly Current Time and Date
3) Copy
4) Change Password
5) write directory to file
6) Edit File Directory
7) Make backup from... (1 Reply)
Hello, I'm supposed to create a simple script to backup onto a network using tar and scp -r command as well as the ~.bashrc to designate commands as a part of bash. I am having trouble making mine work. I would like to ask for input as to what I may be doing wrong. Here it is:
!/bin/bash
#
#... (1 Reply)
HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here
Im explaining the requirement of script.
AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
How to get cpanel backup data in rescue mode?
Server OS 6.3 minimal with cPanel
/dev/sdb1 is main partition
root@rescue ~ # fdisk -l
Anyone can help
Thank you (0 Replies)
Discussion started by: jaydul
0 Replies
LEARN ABOUT FREEBSD
lslogins
LSLOGINS(1) User Commands LSLOGINS(1)NAME
lslogins - display information about known users in the system
SYNOPSIS
lslogins [options] [-s|-u[=UID]] [-g groups] [-l logins]
DESCRIPTION
Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd and output the desired data.
The default action is to list info about all the users in the system.
OPTIONS
Mandatory arguments to long options are mandatory for short options too.
-a, --acc-expiration
Display data about the date of last password change and the account expiration date (see shadow(5) for more info). (Requires root
privileges.)
--btmp-file path
Alternate path for btmp.
-c, --colon-separate
Separate info about each user with a colon instead of a newline.
-e, --export
Output data in the format of NAME=VALUE.
-f, --failed
Display data about the users' last failed login attempts.
-G, --supp-groups
Show information about supplementary groups.
-g, --groups=groups
Only show data of users belonging to groups. More than one group may be specified; the list has to be comma-separated.
Note that relation between user and group may be invisible for primary group if the user is not explicitly specify as group member
(e.g. in /etc/group). If the command lslogins scans for groups than it uses groups database only, and user database with primary GID
is not used at all.
-h, --help
Display help information and exit.
-L, --last
Display data containing information about the users' last login sessions.
-l, --logins=logins
Only show data of users with a login specified in logins (user names or user IDS). More than one login may be specified; the list
has to be comma-separated.
-n, --newline
Display each piece of information on a separate line.
--noheadings
Do not print a header line.
--notruncate
Don't truncate output.
-o, --output list
Specify which output columns to print. Use --help to get a list of all supported columns.
-p, --pwd
Display information related to login by password (see also -afL).
-r, --raw
Raw output (no columnation).
-s, --system-accs
Show system accounts. These are by default all accounts with a UID below 1000 (non-inclusive), with the exception of either nobody
or nfsnobody (UID 65534). This hardcoded default maybe overwritten by parameters SYS_UID_MIN and SYS_UID_MAX in the file
/etc/login.defs.
--time-format type
Display dates in short, full or iso format. The default is short, this time format is designed to be space efficient and human
readable.
-u, --user-accs
Show user accounts. These are by default all accounts with UID above 1000 (inclusive), with the exception of either nobody or nfs-
nobody (UID 65534). This hardcoded default maybe overwritten by parameters UID_MIN and UID_MAX in the file /etc/login.defs.
-V, --version
Display version information and exit.
--wtmp-file path
Alternate path for wtmp.
-Z, --context
Display the users' security context.
-z, --print0
Delimit user entries with a nul character, instead of a newline.
NOTES
The default UID thresholds are read from /etc/login.defs.
EXIT STATUS
0 if OK,
1 if incorrect arguments specified,
2 if a serious error occurs (e.g. a corrupt log).
SEE ALSO group(5), passwd(5), shadow(5), utmp(5)HISTORY
The lslogins utility is inspired by the logins utility, which first appeared in FreeBSD 4.10.
AUTHORS
Ondrej Oprala <ooprala@redhat.com>
Karel Zak <kzak@redhat.com>
AVAILABILITY
The lslogins command is part of the util-linux package and is available from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils
/util-linux/>.
util-linux April 2014 LSLOGINS(1)