first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has to be created. if it doe then it has to just proceed with the new user addition.
1. The problem statement, all variables and given/known data:
how do i get this script to be able to create the directory if it does not exist?
or how do i get this script to run as root?
thanks in advance
2. Relevant commands, code, scripts, algorithms:
i have the script partially written i have rudimentary if/then/else statement where the first line reads: 3. The attempts at a solution (include all code and scripts):
google searches
4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
ECPI college or technology in virginia beach VA, Mr. Blow CIS305 advanced UNIX administration.
we do not have a direct link to the course
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
Last edited by Scott; 03-17-2011 at 05:47 PM..
Reason: Added code tags
Hi, Im newbie,
I wanna to create file in each user directory, how to make that script, maybe someone can give me example, im confusing coz i have to change form one user directory to other
Thank U. (8 Replies)
Please help. I am the beginner. Don't understand about archive file. How to create a directory for the files from each archive with name of directory which equivalent to the base name of the archive. eg I have file abc.txt. How can I create a directory name abc. Thank you (1 Reply)
hello.
i hav accepted name of directory from user through a form.now i need to create a directory under cgi-bin of that name.I am not able to do so.n help is required (12 Replies)
Hi All,
I have directory under /opt/test.
The ownership of the test directory is root:root.
I have login to the server as test user.
I need to have some script to create a directory inside /opt/test.
This script will be called as test user.
When I try to execute... (4 Replies)
Hello,
I am new in AIX please tell how can i create user and add group in this user for example, i want to create user umair and want to add this user primanry group DBA and secondary group ORACLE,how can i do this please tell in detail
Thanks,
Umair (1 Reply)
Hi All,
I am trying to uninstall jdk 1.5 from my Solaris 10 64 bit but some how was not successful.so tried to delete the folder of jdk from /usr but its throughing error as:
Unable to remove directory jdk: Read-only file system
Even I tried to create a dir in /usr but its not allowing me... (4 Replies)
Hello All,
I have to write a shell script and use it in informatica. The script has to perform below actions:
The script gets executed from edw user.
Through the script, a DT folder has to be created under edw_sca user.
Is this scenario possible through a SHELL script or not.
... (2 Replies)
I have a script, which is checking if file exists and move it to another directory
if
then
mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly
mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly
... (9 Replies)
Discussion started by: digioleg54
9 Replies
LEARN ABOUT CENTOS
systemd-suspend.service
SYSTEMD-SUSPEND.SERVICE(8) systemd-suspend.service SYSTEMD-SUSPEND.SERVICE(8)NAME
systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep - System sleep state logic
SYNOPSIS
systemd-suspend.service
systemd-hibernate.service
systemd-hybrid-sleep.service
/usr/lib/systemd/systemd-sleep
DESCRIPTION
systemd-suspend.service is a system service that is pulled in by suspend.target and is responsible for the actual system suspend.
Similarly, systemd-hibernate.service is pulled in by hibernate.target to execute the actual hibernation. Finally,
systemd-hybrid-sleep.service is pulled in by hybrid-sleep.target to execute hybrid hibernation with system suspend.
Immediately before entering system suspend and/or hibernation systemd-suspend.service (and the other mentioned units, respectively) will
run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. The first argument will be "pre", the second either
"suspend", "hibernate", or "hybrid-sleep" depending on the chosen action. Immediately after leaving system suspend and/or hibernation the
same executables are run, but the first argument is now "post". All executables in this directory are executed in parallel, and execution
of the action is not continued until all executables have finished.
Note that scripts or binaries dropped in /usr/lib/systemd/system-sleep/ are intended for local use only and should be considered hacks. If
applications want to be notified of system suspend/hibernation and resume, there are much nicer interfaces available.
Note that systemd-suspend.service, systemd-hibernate.service, and systemd-hybrid-sleep.service should never be executed directly. Instead,
trigger system sleep states with a command such as "systemctl suspend" or similar.
Internally, this service will echo a string like "mem" into /sys/power/state, to trigger the actual system suspend. What exactly is written
where can be configured in the "[Sleep]" section of /etc/systemd/sleep.conf. See systemd-sleep.conf(5).
OPTIONS
systemd-sleep understands the following commands:
-h, --help
Print a short help text and exit.
--version
Print the systemd version identifier and exit.
suspend, hibernate, hybrid-sleep
Suspend, hibernate, or put the system to hybrid sleep.
SEE ALSO systemd-sleep.conf(5), systemd(1), systemctl(1), systemd.special(7), systemd-halt.service(8)systemd 208SYSTEMD-SUSPEND.SERVICE(8)