Day 5 Tasks: 5/90 Days
Pranav Lahitkar
Master of Computer Applications ??25' RHCSA | NETWORKING | AWS | DevOps | JAVA | DBMS
Day 5::=>
Tasks::
Backups are an important part of DevOps Engineer's day to Day activities The video in References will help you to understand How a DevOps Engineer takes backups (it can feel a bit difficult but keep trying, Nothing is impossible.)
Answer 1)=>
#!/bin/bash
# Check if the correct number of arguments are provided
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <directory_name> <start_number> end_number>"
exit 1
fi
# Extract arguments
directory_name="$1"
start_number="$2"
end_number="$3"
# Loop through the specified range and create directories
for ((i=start_number; i<=end_number; i++));
do
padded_number=$(printf "%02d" $i)
mkdir -p "${directory_name}${padded_number}"
done
echo "Directories created successfully."
Answer 2)=>
#!/bin/bash
# Define backup directory
backup_dir="/path/to/backup/directory"
# Create backup directory if it doesn't exist
mkdir -p "$backup_dir"
# Create a timestamp for the backup file
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
# Create a tar archive of the current directory
tar -czf "$backup_dir/work_backup_$timestamp.tar.gz" .
echo "Backup created successfully in $backup_dir.
Answer 3)=>
Answer 4)=>
A user is an entity, in a Linux operating system, that can manipulate files and perform several other operations. Each user is assigned an ID that is unique for each user in the operating system. In this post, we will learn about users and commands which are used to get information about the users. After installation of the operating system, the ID 0 is assigned to the root user and the IDs 1 to 999 (both inclusive) are assigned to the system users and hence the ids for local user begins from 1000 onwards.
Answer 5)=>
┌──(root?kali)-[/]
└─# cat /etc/shadow | awk -F : '{print $1}'
root
daemon
bin
sys
sync
games
man
领英推荐
lp
news
uucp
proxy
www-data
backup
list
irc
_apt
nobody
systemd-network
systemd-timesync
messagebus
tss
strongswan
tcpdump
usbmux
sshd
dnsmasq
avahi
speech-dispatcher
pulse
lightdm
saned
polkitd
rtkit
colord
nm-openvpn
nm-openconnect
_galera
mysql
stunnel4
_rpc
geoclue
Debian-snmp
sslh
ntpsec
redsocks
rwhod
_gophish
iodine
miredo
statd
redis
postgres
mosquitto
inetsim
_gvm
kali
pranav
vishnuji
Full Stack Developer Intern @nuverse || Mca || Bca || Author || SWoC'23 || GSSoC'24 || Student || Campus Ambassador || Tech Blogger
1 年Consistency!!!!! Pranav Lahitkar