• Home
  • Downloads
  • Contact Us
  • Report Broken Link
Friday, May 9, 2025
  • Login
lessons4you.info
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link
No Result
View All Result
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link
No Result
View All Result
Lessons4you.info
No Result
View All Result

VSFTP Chroot or Jail Users – Limit Users to Only Their Home Directory

How to Root Galaxy S4 (LTE) I9505 on Leaked Android 4.4.2 XXUFNA1 KitKat Test Firmware

How to Do A Full Backup Using The tar Command in Linux (CentOS/RedHat/Debian/Ubuntu)

by
December 11, 2021
in Uncategorized
Reading Time: 2 mins read
A A
Share on FacebookShare on Twitter

Having a snapshot of your system right after the initial installation gives you something to revert back to should you want to reconfigure your server without starting from scratch or you can take backup your system after a time interval to keep your work safe for future.

Enter the following commands:

1
2
3
4
5
 
$ cd /
$ mkdir backups
$ cd backups
 

Use the nano editor to create our shell script file with the command:

1
2
3
 
$ nano fullsystem-backup.sh
 

and enter the following command into it (and don’t miss that period at the end of the command):

1
2
3
4
5
6
7
8
9
 
#!/bin/bash
TODAY=`/bin/date +%Y%m%d-%H`
FILENAME="FULLBACKUP-${TODAY}"
 
tar -cvpf /backups/${FILENAME}.tar --directory=/ --exclude=proc --exclude=sys --exclude=dev/pts --exclude=backups .
 
exit 0
 

Exit the editor (Ctrl-X) saving the file.

1
2
3
4
5
6
7
8
9
10
 
The c option creates the backup file.
The v option gives a more verbose output while the command is running. This option can also be safely eliminated.
The p option preserves the file and directory permissions.
The f option needs to go last because it allows you to specify the name and location of the backup file which follows next in the command (in our case this is the /backups/fullbackup.tar file).
The --directory option tells tar to switch to the root of the file system before starting the backup.
We --exclude certain directories from the backup because the contents of the directories are dynamically created by the OS. We also want to exclude the directory that contains are backup file.
Many tar references on the Web will give an exclude example as:
--exclude=/proc
 

You have to make your script executable before you can run it. To do that and run it enter the following two commands:

1
2
3
4
 
$ chmod 750 /backups/fullserver-backup.sh
$ ./backups/fullserver-backup.sh
 

To restore your “tar ball” you need to copy it to the top-most point in the file tree that it backed up. In our case the –directory option told tar to start backing up from the root of the file system so that’s where we would want to copy the tar ball to. Then simply replace the c option with the x parameter line so:

1
2
3
 
$ tar -xvpf /fullbackup.tar
 

Tags: BackupTAR
Previous Post

VSFTP Chroot or Jail Users – Limit Users to Only Their Home Directory

Next Post

How to Root Galaxy S4 (LTE) I9505 on Leaked Android 4.4.2 XXUFNA1 KitKat Test Firmware

Related Posts

How To Install The TWRP Recovery on Xiaomi Redmi 1s
Uncategorized

How To Install The TWRP Recovery on Xiaomi Redmi 1s

May 14, 2022
MIUI Collection Of Gapps (2.3.x – 5.0.x)
Uncategorized

MIUI Collection Of Gapps (2.3.x – 5.0.x)

May 14, 2022
Download Android 5.1.x Lollipop PA Gapps
Uncategorized

Download Android 5.1.x Lollipop PA Gapps

May 15, 2022
Download gapps for Android 5.1 Lollipop Cyanogemod 12.1
Uncategorized

Download gapps for Android 5.1 Lollipop Cyanogemod 12.1

May 14, 2022
Reddit AMA with OxygenOS Team OnePlus
Uncategorized

Reddit AMA with OxygenOS Team OnePlus

May 14, 2022
How to Remove Adobe Updater from OS X Menu Bar?
Uncategorized

How to Remove Adobe Updater from OS X Menu Bar?

July 19, 2023
Next Post

How to Root Galaxy S4 (LTE) I9505 on Leaked Android 4.4.2 XXUFNA1 KitKat Test Firmware

  • Home
  • Downloads
  • Contact Us
  • Report Broken Link

© 2022 lessons4you.info

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • Videos
  • Downloads
  • Help
    • Contact Us
    • Report Broken Link

© 2022 lessons4you.info