Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Having directories with 777 permissions is very dangerous. Write a find command

ID: 3917795 • Letter: H

Question

Having directories with 777 permissions is very dangerous. Write a find command that will locate, print and change the directories that have permission 777 to 755 (note: use -exec).

Write a find command that will look for EMPTY files and remove them from your file system.

Write a find command that will locate and list all the files that belong to the user student.

Write a find command that will locate files that were accessed in the last 50 days.

white a find command that will locate files that were modified in the last 50 days.

Write a find command that will locate files that were modified more than 50 days back and less than 100 days.

Write a find command that will locate files that are between 50MB and 100MB in size.

Assuming you have an images directory in your home directory, write a tar command that will create a compressed gzip file of the images directory. Mane the compressed file myImages.tar.gz

write a tar command to untar the file you created in question 1.

Create a incremental backup system using rsync to back up rour / partition on your hard drive to a remote system.

You need to use the cron facility from Linux. You can read about how to use the cron functionality here (Links to an external site.)Links to an external site..

You will create 1 rsync command for the dialy backups, one for the weekly backups and one for the monthly backups.

Explanation / Answer

Having directories with 777 permissions is very dangerous. Write a find command that will locate, print and change the directories that have permission 777 to 755 (note: use -exec).

find / -print -type d -exec chmod 755 {} ;

-print: print names

-type d: seach for directories

-exec: execute chmod command on all the directories found

Write a find command that will look for EMPTY files and remove them from your file system.

find / -size 0 -type f -exec rm -rf {} ;

-size: specify size of file in MB

Write a find command that will locate and list all the files that belong to the user student.

find / -user student

-user: specify name of the user

Write a find command that will locate files that were accessed in the last 50 days.

find / -atime 50

-atime: access time

white a find command that will locate files that were modified in the last 50 days.

find / -mtime 50

-mtime: modified time

Write a find command that will locate files that were modified more than 50 days back and less than 100 days.

find / -mtime +50 –mtime -100

Write a find command that will locate files that are between 50MB and 100MB in size.

find / -type f -size +50M -size -100M

Assuming you have an images directory in your home directory, write a tar command that will create a compressed gzip file of the images directory. Mane the compressed file myImages.tar.gz

tar -cvfz myImages.tar.gz /home/images

-c: creates archive

-v: displays erbose info

-f: creates archive with given filename

-z: create tar file with gzip

write a tar command to untar the file you created in question 1.

tar -xvf myImages.tar.gz

-x: extract archive

Create a incremental backup system using rsync to back up rour / partition on your hard drive to a remote system.You need to use the cron facility from Linux. You can read about how to use the cron functionality here (Links to an external site.)Links to an external site..You will create 1 rsync command for the dialy backups, one for the weekly backups and one for the monthly backups.

rsync -avzrh / root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily

rsync -avzrh / root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily root@IP_ADDR_REMOTE_SYSTEM:/home/BackupWeekly

tar -cvjf root@IP_ADDR_REMOTE_SYSTEM:/home/monthly.tar.bz2 root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily

-v : verbose

-r : copy data recursively

-a : archive modepreserves symbolic links, file permissions, user & group ownerships and timestamps

-z : compress data

-h : human-readable

Cron:

crontab -e

When opened, add above commands to the file as below:

00 18 * * * rsync -avzrh / root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily : backup daile at 18:00 hours

00 18 * * 6 rsync -avzrh / root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily root@IP_ADDR_REMOTE_SYSTEM:/home/BackupWeekly: backup every week on saturday(6) at 18:00 hours

00 18 1 * * tar -cvjf root@IP_ADDR_REMOTE_SYSTEM:/home/monthly.tar.bz2 root@IP_ADDR_REMOTE_SYSTEM:/home/BackupDaily: backup every month on 1st at 18:00 hours

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote