We have a important directory say /home/user/Picture in my case user=u-man
, everyday new contents are added there , these data s are important we need to take a backup it every day , how ??
our target directory = /home/user/Picture
we will make a backup of above directory
open terminal type :
cd Desktop
tar cvzf anuj.tar.gz /home/u-man/Pictures
it will make a anuj.tar.gz file on desktop
now copy and past following script
#!/bin/bash
gunzip /home/u-man/Desktop/anuj.tar.gz
tar uvf /home/u-man/Desktop/anuj.tar /home/user/Picture
gzip /home/u-man/Desktop/anuj.tar.gz
exit 0
save it ass shell
now type: sudo chmod +x shell
now every day before shutting down your PC you need to do only one thing that is : ./shell
see the screen shoot
script-to-take-backup-of-linux-system
, everyday new contents are added there , these data s are important we need to take a backup it every day , how ??
our target directory = /home/user/Picture
we will make a backup of above directory
open terminal type :
cd Desktop
tar cvzf anuj.tar.gz /home/u-man/Pictures
it will make a anuj.tar.gz file on desktop
now copy and past following script
#!/bin/bash
gunzip /home/u-man/Desktop/anuj.tar.gz
tar uvf /home/u-man/Desktop/anuj.tar /home/user/Picture
gzip /home/u-man/Desktop/anuj.tar.gz
exit 0
save it ass shell
now type: sudo chmod +x shell
now every day before shutting down your PC you need to do only one thing that is : ./shell
see the screen shoot
script-to-take-backup-of-linux-system
No comments:
Post a Comment