NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#!/bin/bash

echo "1: Backup"
echo "2: User Management"

while [ 1 ]
do

read menu
case $menu in
1)
echo "Backup for Zip"
echo "a: backup now"
echo "b: set backup timer "
while [ 1 ]
do
read backup
case $backup in
a)
sudo tar -cvpzf backup.tar.gz /root
;;
b)
echo "This is for scheduled backup"
echo -n "Enter the minute Example:Enter */1 for every minute:"
read a
echo -n "Enter hour (*") from 0-23:"
read b
echo -n "Enter day of month (*) from 0-30:"
read c
echo -n "Enter month (*) from 1-12:"
read d
echo -n "Enter day of week (*) from 0-7 as 0 being monday:"
read e
echo -n "Name of the backup file:"
read f
echo -n "path of backup file (example:new/newfolder):"
read g
echo -n "Name of source:"
read source

echo "$a $b $c $d $e tar -cpzf ~/$g/$f /root/$source " >> crontab.txt
crontab crontab.txt
;;
End)
break
;;
*)
echo "Choose option a-b or "End" to exit"
;;
esac
done
;;
2)
echo "User Mangement" #display the usermanagement
echo "a: Add new group"
echo "b: Add new users"
echo "c: Delete users"
echo "d: Delete group"
echo "e: Edit users"
echo "f: Edit groups"
echo "End: To exit"
while [ 1 ]
do
read user
case $user in
a)
echo "Add a new Group"
echo -n "Enter group name:"
read NG #read group name
sudo addgroup $NG
;;
b)
echo "Add a New User"
echo -n "Enter user name:"
read USERADD #create useradd
#echo -n "Enter password:"
#read P
sudo useradd -m $USERADD
sudo passwd $USERADD
;;
c)
echo "Delete a User"
echo -n "Enter username to be deleated:"
read DELETE
sudo userdel $DELETE
;;
d)
echo "Delete a Group"
groups
echo -n "Name of the group to be delete:"
read delete
sudo groupdel $delete #group can be deleted
;;
e)
echo "choose to edit users"
echo -n "Enter name of group to view it:"
read edituser
sudo passwd $edituser
;;
f)
echo "choose to edit groups"
echo -n "Enter groupname to add user:"
read editgroup
echo -n "Enter username to add user in group:"
read adduseringroup
sudo usermod -a -G $editgroup $adduseringroup
;;
End)
break
;;
*)
echo "choose option from a to f(a-f) or "Exit" to exit" #end the program
esac
done
;;
End)
break
;;
*)
echo "Choose options 1-2 or "End" to quit"
;;
esac
done


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.