Backup
1. Standard Backup
1. Make 2 directories
mkdir project1 mkdir backup1
2. Go inside the folder project1 and make some files
cd project1 touch notes accounts list1 nano notes nano accounts nano list mkdir codes cd ..
3. use the cp command to copy and backup
cp -r project1 backup1/
4. go inside the backup1 folder and check
5. delete the contents of a file in project1
6. go up one level and repeat backup command
7. go inside the backup1 folder and check again
2. Secondary Backup
7. using secondary backup option in cp
cp -br project1 backup1/
3. Numbered Backup
8. using numbered backup option
cp -r --backup=numbered project1 backup1/
4. Incremental
rsync
remote syncronisation
incremental backup
rsync -avrz source destination
incremental backup and delete files
rsync -avrz --delete source destination
5. cron
https://en.wikipedia.org/wiki/Cron
crontab -e
press enter to choose nano as the text editor
Type this at the bottom
0 5 * * * rsync -avrz source destination
press control o and enter and control x