Part 1: Automated Account Management
First Script “
Clear; This is first used to clear the terminal
#read the username from users.txt
un=`cat users.txt|cut -d ” ” -f 1`
#read the Home Directory from users.txt
hd=`cat users.txt|cut -d ” ” -f 2`
#read the gecos string from users.txt
g=`cat users.txt|cut -d ” ” -f 3-4`
#generate the random password
p=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8 ; echo ”`
#display the password
echo “The password of user $un is $p”
#add the user by useradd command
adduser -d $hd -c “$g” $un
#assign the password and redirect the output into/dev/null
(echo $p|passwd $un –stdin) >/dev/null
echo “Enter the username”
read un
grep $un /etc/passwd
if test $? -eq 0
then
hd=`grep $un /etc/passwd|cut -d “:” -f 6`
tar -czf /tmp/back1.tar $hd
userdel -r $un
Unlike FreeBSD, ZFS is not part of the Linux base installation due to licensing issues, which is a unexpected because it would be nice to install Ubuntu on a ZFS pool.
In any case, we can still run ZFS on Linux by installing it with the following commands.
ZFS is a joined record framework and intelligent volume administrator planned and executed by a group at Sun Microsystems driven by Jeff Bonwick and Matthew Ahrens. Its advancement began in 2001 and it was authoritatively declared in 2004. In 2005 it was incorporated into the fundamental trunk of Solaris and discharged as a feature of OpenSolaris. Right now, as of January 2015, it is local to Solaris, OpenSolaris, OpenIndiana, illumos, Joyent SmartOS, OmniOS, FreeBSD, Debian GNU/kFreeBSD frameworks, NetBSD, OSv and bolstered on Mac OS with MacZFS.
On Backups, this framework is totally in light of dataset snapshots and replication back to our capacity servers utilizing zfsnap and zxfer. zfsnap takes a snapshot each day for a week and consistently for a month. It discards old ones consequently so you don’t amass overabundance snapshots. For instance, the greater part of our present Jail servers’ dataset get snapshotted, at that point every depiction gets repeated back to the capacity servers. It’s quick.
The ZFS filesystem is accessible for Ubuntu as either a FUSE module or a local portion module. The part module is given as a matter of course. To introduce the client level instruments, just introduce:
sudo apt install zfsutils-linux or sudo apt install zfs
For every single current variant from 16.04 ahead.
Notwithstanding have the capacity to have ZFS on root, introduce:
sudo apt install zfs-initramfs
Part 2: Design of a File System
In the following example, we will create a RAIDZ-2 Storage Pool using 3 hard disks. In ZFS RAIDZ-2 is like hardware RAID 6 in that two hard disks can fail before the data on the
That is the zfs now running as proposed on a linux operating system.
Changing User access rights on ubuntu is not a big task to tackle, One needs only to be conversant with the following tips:
Utilize chown to change possession and
chmod to change rights.
utilize the – R choice to apply the rights for all documents within a catalog as well.
Note that both these charges simply work for registries as well. The – R alternative rolls out them additionally improvement the authorizations for all documents and catalogs within the registry.
For instance
chown – R username:group catalog
will change proprietorship (for the group and client as well) everything being equal and catalogs within index and registry itself.
chown username:group catalog
will just change the authorization of the organizer registry however will leave the documents and envelopes inside the catalog alone.
you have to utilize sudo to change the proprietorship from root to yourself.
sudo chown -R $USER:$USER /home/$USER/
sudo chmod -R 750 /home/$USER/
# get path
path=$1
# display files information
find $path -type f ( -name “*.mp3” -o -name “*.mp4” -o -name “*.aac” -o -name “*.mov” -o -name “*.avi” -o -name “*.vid” ) | xargs du -sh
# remove files
find $path -type f ( -name “*.mp3” -o -name “*.mp4” -o -name “*.aac” -o -name “*.mov” -o -name “*.avi” -o -name “*.vid” ) -exec rm -f {} ;
Get-ChildItem -Path C: -Force /*get path from item*/
Get-ChildItem -Path $environment:ProgramFiles -Recurse /*get the path from programming files*/
-Include *.exe | Where-Object -FilterScript /*to find the object from script*/
-and ($_.Length -ce data storage) -and ($_.Length -le data storage)
Copy-Item -Path C:boot.
ini -Destination C:boot.dat /*to copy the item from directory*/
(New-Object -script Object Scripting.FileSystemObject)
New-Item -Path ‘C:tempNew Folder’ -ItemType Directory /*a folder to store*/
/* Assumption of home directories are descendants of /users
Get-Data-Path C:boot.ini
[boot loader]
timeout=0
default=multi(0)disk(0)rdisk(0)partition(1)WINDOWS[operating systems]
/*The script takes an argument the filesystem name
multidata()disk()rdisk()partition(1)WINDOWS. mp3 =”receive file” /*to find the summary*/
/noexecute=AlwaysOff.aac /fastdetect /*detection of fast execution*/
multi(0)disk(0)rdisk(0)partition(1)WINDOWS.mp4=”Descendants of users”
with Data Execution Prevention” /notexecuted=option /datadetect
(Get-Content -Path C:boot.initiate).Length.avi() /*to find the length of data storage*/
/*to find the initiation of argument storage*/
$System = Get-Context -Path C:temporaryDomainMembers.txt
$scl = Get-Scl fs1sharedfilesdata
$AccessData = New-Object System.Security.AccessControl.FileSystemAccessRule(“FullControl”,”Data”)
$scl.RemoveAccessDta($AccessData)
$scl | Set-Scl fs1sharedfiles
Remove-Item -Path C:tempDeleteMe /*to remove files*/
References
Ab Karim, M. B., Luke, J. Y., Wong, M. T., Sian, P. Y., & Hong, O. (2016, October). Ext4, XFS, BtrFS and ZFS Linux file systems on RADOS Block Devices (RBD): I/O performance, flexibility and ease of use comparisons. In Open Systems (ICOS), 2016 IEEE Conference on (pp. 18-23). IEEE.
LaCroix, J. (2016). Mastering Ubuntu Server. Packt Publishing Ltd.
Joyent, Z. F. S. (2014). Performance Analysis and Tools. Retrieved Mar, 12.
Shen, Y., & Luo, L. (2014, December). Fwrite: An Approach to Optimize Write Performance of ZFS on Linux. In Computational Intelligence and Design (ISCID), 2014 Seventh International Symposium on (Vol. 2, pp. 57-60). IEEE.
Swetha, K., & Sivakumar, A. P. (2015). A Multi-level Services for Scaling of applications in Cloud Services.
Lora, A., Nantista, G., & Pifferi, A. (2016). Setup of a redundant network storage system. A legacy approach. SMART eLAB, 8, 1-8.
Olson, J. T., Patil, S. R., Shiraguppi, R. M., & Spear, G. A. (2016). U.S. Patent No. 9,323,462. Washington, DC: U.S. Patent and Trademark Office.
Wojs?aw, D. (2017). Installation. In Introducing ZFS on Linux(pp. 41-49). Apress, Berkeley, CA.