Question: CHALLENGE: Create the following folder structure inside the existing system folder / opt: / opt enterprise - app bin code docs flags libs logs scripts

CHALLENGE:
Create the following folder structure inside the existing system folder /opt:
/opt
enterprise-app
bin
code
docs
flags
libs
logs
scripts
Ensure the user root is the owner of the enterprise-app folder.
Ensure your regular user account owns all the other folders in the structure except the bin/ folder (which should be owned by the root user).
Create the following files:
app.py in the bin folder
stdout.log and stderr.log in the logs folder
README.txt in the docs folder
clean.sh in the scripts folder
pid.info in the flags folder
Set the permissions for the created files as follows:
Anyone can execute the script scripts/clean.sh.
Anyone can read the files inside logs, but they cannot be executed and can only be written by the owner (your regular account).
The file bin/app.py should have the mode 700.
Create a symbolic link named alt_app_access under the structure code folder. The link must point to the bin/app.py file.
Generate a report file with information about two files:
bin/app.py
scripts/clean.sh
Extract the information from the two files mentioned above using the stat command as in the following example:
Listing 1. Example using the /etc/passwd File as target:
$ stat -c "INODE:%n:%i"/etc/passwd
INODE:/etc/passwd:16948603
TIP
Look at the stat --help*
Using redirections save the information in a report file named report.out that must be created inside the docs folder.
The information that must be extracted from the files is the following:
File owner in the format: OWNER::
File octal mode in the format: PERMISSIONS::
File inode number in the format: INODE::
Finally, create the enterprise_app_backup.tar.gz compressed archive file of the /opt/enterprise-app folder structure and files and save it inside the /tmp directory.
TIP
You will need the following commands to complete this task:
touch
mkdir
echo
tree
chown
chmod
cat
ls
ln
stat

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!