Note
This project was undertaken as a part of my Operating System Coursework. I am not allowed to publish the source code or even the design decisions in a public forum. Hence I have committed only the test cases which should hopefully provide you a gist of the project.
If you want to have a peek at my design decisions or the source code please contact me at [email protected]. I will reply after discussing it with my Professor Erez Zadok.
Description
This is an implementation of a backup file system build using wrapfs, which is a null layer file system. It allows user to automatically create backups of regular files defined by write frequency interval.
- Create backups of a file for every n writes; defined by writefrequency.
- Make backups invisble to the user.(even with ls -a its not visible)
- List all versions of a backup file.
- Delete a oldest, newest or all versions of the file.
- View Oldest, Newest or Nth version of a file from a given offset.
- Restore newest or Nth version of a file.
cd repo
make clean
make
mount -t filesytem
-o maxver=$maxversions
-o writefrequency=$writefrequency
$lower_level_path $mount_path
umount $mount_path
cd CSE-506
make clean
make
bkpctl is the executable.
List all Versions
./bkpctl -l $filepath
Delete a Specific Version
./bkpctl -d $version_to_delete $filepath
View a Specific Version for a given offset
./bkpctl -v $version_to_view -p $offset $filepath
Restore a Specific Version
./bkpctl -r $version_to_restore $filepath
-l : List all Versions
-d : Delete a Version
- newest
- oldest
- all
-v : View contens of a version
- newest
- oldest
- N
-p : offset from where to start reading
-r : Restore a version
- newest
- N
-h : Help
- All the test cases are self sufficient. The only pre-requisiste is that bkpfs module is loaded using insmod,before executing the test cases.
- Some of the operations like mount unmount writing /mnt/bkpfs require root or relevant privileges.
- Have catalogued all the test cases at the end of the document for easier reference.
utils.sh - This has common scripts shared by all other test cases such as mounting, unmounting, creating backups, cleanup of backups ones the test cases are over.
- Mount - test_mount.sh
- Unmount - test_umount.sh
- List Versions - test_list_versions.sh
- List Versions of file with 0 backups - test_no_backups.sh
- Backup Retention Policy - test_backups_after_max.sh
- Write Frequency - test_write_frequency.sh
- Delete Newest - test_delete_versions_newest.sh
- Delete Oldest - test_delete_versions_oldest.sh
- Delete All - test_delete_versions_all.sh
- Delete a Non Existent Backup - test_delete_non_existent.sh
- Backup Visibility Policy - test_hidden_backups.sh
- View Contents of a Version N - test_read_content.sh
- View Contents Oldest - test_read_content_oldest.sh - NA
- View Content Newest - test_read_content_newest.sh - NA
- View Contents With offsets - test_read_content_with_offset.sh
- View Contents of a Non Existent Backup - test_view_non_existent.sh
- Restore from a Version N - test_restore_n.sh
- Restore latest Version - test_restore_newest.sh
- Restore a non existent backup - test_restore_non_existent.sh
User Program tests
- No operation specified - test_no_actions.sh
- Multiple operations specified - test_multiple_actions.sh
- No input path provided - test_no_input_path.sh
- Invalid Delete Params - test_invalid_delete_params.sh
- Invalid Restore Params - test_invalid_restore_params.sh
- Invalid View Params - test_invalid_view_params.sh