Browse Source

docs(backup-manager): improve readme and audit by adding examples

pull/1979/head
miguel 1 year ago committed by MSilva95
parent
commit
0c70ee4a5b
  1. 17
      subjects/devops/backup_manager/README.md
  2. 19
      subjects/devops/backup_manager/audit/README.md

17
subjects/devops/backup_manager/README.md

@ -148,6 +148,23 @@ backup_test.tar office_docs.tar personal_data.tar
> There is many ways to run tasks in background and to perform actions on a specific time, the implementation proposed in this exercise is good for learning but should not be your preferred choice for production environments.
**.tar files**
In Linux, tar is a command-line utility used to create, manipulate and extract .tar (tape archive) files. Here are some common operations you can perform with .tar files using the tar command:
- To create a .tar file:
`tar -cvf archive.tar file1 file2 directory1/`
- To extract the contents of a .tar file:
`tar -xvf archive.tar`
- To extract a specific file from a .tar file:
`tar -xvf archive.tar file1`
- To compress a .tar file using gzip:
`tar -cvzf archive.tar.gz file1 file2 directory1/`
- To list the contents of a tar file:
`tar tf archive.tar`
- To list the contents of a tar archive in a long listing format:
`tar -tvf archive.tar`
### References
- [Error handling in Python](https://docs.python.org/3.10/tutorial/errors.html)

19
subjects/devops/backup_manager/audit/README.md

@ -57,7 +57,13 @@ $ python3 ./backup_manager.py list
##### Verify that the following command runs without errors: `python3 backup_manager.py start`.
###### Can you confirm that the `backup_service.py` process is running? (For example you could use `ps -ef | grep backup_service`).
###### Can you confirm that the `backup_service.py` process is running? (For example you could use `ps -ef | grep backup_service`). Check the example bellow:
```bash
$ python3 ./backup_manager.py start
$ -ps -ef | grep backup_service
user 1520028 2736 0 18:30 ? 00:00:00 python3 ./backup_service.py start &
```
##### Now run the command `python3 backup_manager.py start` again.
@ -107,7 +113,16 @@ $ cat logs/backup_service.log
[13/02/2023 18:21] Backup done for testing in backups/backup_test.tar
```
##### Follow the example above and then open the `backup_test.tar` file to ensure that the backup process was successful. Verify that the files are not empty or damaged and that it matches the original directory.
##### Follow the example above and then open the `backup_test.tar` file to ensure that the backup process was successful. Verify that the files are not empty or damaged and that it matches the original directory. The result should be similar to the following example:
```console
$ ls
backup_test.tar
$ tar -tvf backup_test.tar
drwxrwxr-x user/user 0 2023-04-19 10:23 testing/
-rw-rw-r-- user/user 0 2023-04-19 10:23 testing/1
-rw-rw-r-- user/user 0 2023-04-19 10:23 testing/2
```
###### Was the backup created successfully?

Loading…
Cancel
Save