Backup using bash shell

Backup using bash shell
Backup using bash shell 





If you do not have a backup product or backup application or backup solution in your environment.

Most of the time smaller companies do not have the back up third party application that does the backup for them.So what do they have to do is they have to rely on this operating system tools that are available todo the backup and run those backup manually by creating a little script.


#!/bin/bash

tar cvf /tmp/backup.tar /etc /var  (You could actually pick up any directory that you want)

gzip /tmp/backup.tar

Backup using bash shell
Backup using bash shell

find /tmp/backup.tar.gz -mtime -1 -type f -print &> /root/Desktop/backupfile

if [ $? -eq 0 ]

then

echo Backup was created

echo

echo Archiving backup

else

echo Backup failed

fi


Read More: Koo app yellow tick verification system

Read More: Install a Windows Server in AWS

Read More: Uses of samba server and  key features of the samba server


Oldest

1 Comments:

Click here for Comments
July 17, 2021 at 12:24 AM ×

Well done

apurva srivastava
Reply
avatar