Server Administration and Management with Shell Scripts and ZFS Volume

Verified

Added on  2023/06/07

|13
|695
|492
AI Summary
This guide covers server administration and management with shell scripts and ZFS volume. It includes topics such as automated account management, designing file systems, implementing file systems, and file system management with scripts. The guide provides step-by-step instructions and examples to help users understand the concepts. It also offers access to solved assignments, essays, and dissertations on this topic at Desklib.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
SERVER
ADMINISTRATION AND
MAINTENANCE

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Table of Contents
1. Automated Account Management......................................................................................2
2. Designing File Systems......................................................................................................5
3. Implementing the File system.............................................................................................7
4. File System Management with Scripts.............................................................................10
1
Document Page
1. Automated Account Management
This task we are going to make the two shell scripts and it is used to manage the user
information. First scripts is to reads the text file called users.txt that contains the below
information.
Shell Script
#!/bin/bash
FILE="/home/ubuntu/Documents"
echo "*** File - $FILE contents ***"
cat $FILE
After run the shell scripts and it is provide the output. It is displayed below,
2
Document Page
After, we will assume the users on the system without any interactive input. It is shown
below.
The Second script is to remove the user account by using the following script.
#!/bin/bash
#
for user
do
userdel r $user
done
#
for user1
do
rm -rM /home/$user1
done
#
The output is shown below.
3

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Home directory archiving is shown below.
4
Document Page
2. Designing File Systems
Here, we will needs to build the server to store the user data by using the ZFS volume.
First, user needs to install the ZFS by using the following steps.
First, view the sources are enabled or not by enter the following command and it is illustrated
as below.
5
Document Page
After, update the system by enter the following command.
6

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
3. Implementing the File system
In this task, we are going to implement the storage system by install the ZFS and
Ubuntu virtual machine. First, user needs to Install Ubuntu virtual Machine.
7
Document Page
Then install the ZFS utility.
After, view the disk volume and it is illustrated as below.
8
Document Page
After, create the pool named as pool-name. It is displayed as below.
Finally user successfully designed the ZFS volume.
9

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
4. File System Management with Scripts
Here, we will created the two scripts for file system management. The First scripts is
to make the user home directories are owned and only accessible by the owner. It is shown
below.
for dir in /home/ubuntu*
do
if [ -d "$dir" ]
then
username=$(basename "$dir")
echo "chown -R $username $dir"
fi
done
The second scripts is to looks the file system to find the objects like mp3, mp4, aac, vid and
mov files. It is shown below.
#!/bin/sh
file="$1"
outfile=${file%.flac}.mp3
eval $(metaflac --export-tags-to - "$file" | sed "s/=\(.*\)/='\1'/")
flac -cd "$file" | lame --preset fast extreme \
10
Document Page
--add-id3v2 --tt "$TITLE" --ta "$ARTIST" --tl "$ALBUM" \
--ty "$DATE" --tn "$TRACKNUMBER" --tg "$GENRE" \
- "$outfile"
#Search MP4
find $HOME -name "*.mp4" -group vivek
#Search Video Files#
find /home/directory -type f -exec file -N -i -- {} + |
sed -n 's!: video/[^:]*$!!p'
find /tmp /var/tmp ~ -type f -size +10M \
-mtime +60 -ctime -100 \
-exec file -N -i -- {} + |
sed -n 's!: video/[^:]*$!!p'
#Search .avi files
#!/bin/sh
cd /media/Media/
files=$(find . -type f -iname *.avi -exec echo '{}' +)
cd /media/Media/Xbox360
for avifiles in "$files[@]"; do
ln -s $avifiles .
done
exit 0
11
Document Page
12
1 out of 13
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]