Skip to main content

Lightweight file manager for backing up and organizing your data

Project description

SFS (Symbolic File System)

A command line utility that provides a lightweight setup for organizing and backing up files

SFS stores files from a variety of sources, aka collections, that may include directories and removable media, as symbolic links to the source files. It also stores the metadata of the source files so that files can later be queried without having to plug in the source media.

An SFS is a managed directory which is initialized with the command: sfs init. All commands to be executed in the context of an individual SFS must be run from within the SFS directory tree. Files are added using the command sfs add-col my_collection /path/to/source (add collection). SFS Files are symlinks to source files in added collections. Foreign links and other files can also exist in an SFS but they are not managed by it and are mostly ignored.

Use Cases

  • Organizing Data Across Discs

    SFS was built with the motivation of being able to have a combined view of data stored across multiple discs, organize the data in the view and reflect changes back to source discs. This is an effortless way of organizing content across discs which is otherwise painfully slow and limited as we can operate on a limited number of discs simultaneously and inter disc transfers are very slow. Since all operations in an SFS are performed within the same disc and on symlinks instead of heavy files, they are much faster

    Note: To view the content of a file we obviously do need the source to be available. So, if there is a need of viewing file content while organizing them, the source needs to be plugged in which might or might not be appropriate for all use cases. However, SFS makes it easy to query the source of an SFS File when it is needed to be accessed

  • Backing up Files

    While there are lots of ways to make direct backups of directories, an SFS allows you to organize the content while backing them up and potentially saving them to multiple destinations with a single command. For exaback themmple, you might have an SFS in which you add local files, like multimedia and documents, organize them in hierarchies resembling your storage hierarchies, then map the top-level SFS directories to backup destinations and preform the backup with a single save command. Periodically, you will have to synchronize the SFS, sort the newly added local files and rerun the backup.

  • Decouple Data Storage and View

    Data often needs to be stored in a certain way which might not be similar to the hierarchy in which you want to view it. SFS allows you to create a virtual hierarchy for viewing content. For example, consider that you have data saved in a number of discs or directories, organized as music, documents, projects, etc. Your options are either to keep a copy of the important files locally, which we commonly do, or to plugin all the media one by one and search for the files you need, which hopefully no one does. You can instead create an SFS instance, dump all your discs into it, create a directory in the SFS for local files and copy all needed files to your local system. You can search for files in all your discs locally and, periodically, you can update what files to be kept in you local system

Commands

# SFS Operations
init            Initialize a new SFS in the current directory
is-sfs          Check whether a path is inside an SFS

# Collection Operations
add-col         Add a named collection to the current SFS
                -n, --name
                    Collection name (defaults to source root directory name)
is-col          Check whether a path is inside any collection added to the current SFS
list-cols       List all collections in the current SFS
del-col         Delete a collection and associated symllinks from 
                the current SFS    
sync-col        Synchronize any changes made to a collection (addition, 
                modification and deletion of files)

# Querying SFS files
query           Query metadata of a file or directory in an SFS

# Deduplication
find-dups      Check for duplicate files (by name and size) recursively 
               in a target directory and save dulicates to a JSON file
               in the target directory
               -o, --override
                    Override the generated JSON file if it exists
               -d, --del-duplicates
                    Mark duplicates (all but first in a list of duplicate files) for deletion
dedup          Use the JSON file (after manually choosing which files to
               keep) to delete duolicates in a target directory
               -d, --del-json
                    Delete the generated JSON file after a successful de-deuplication

# Merge
merge          Merge two non-nested directories in an SFS. In case of merge
               conlicts, the process terminates after saving conflicting files
               to a JSON. The file can be edited and used for completing the
               merge operation
               -k, --on-conflict
                    Conflict resoution can be one of keep-target, keep-source or keep-both
               -c, --continue
                    Use specified or default conflict rsolution without saving conflicts JSON
               -j, --json
                    Use the generated JSON file for handling conflicts 
               -o, --override
                    Override the generated JSON file if it exists
               -d, --del-json
                    Delete the generated JSON file after a successful merge
               -s, --del-source
                    Delete the source directory after a successful merge

Usage

Install with pip

pip install symbolic-file-system

Or clone this repo and run setup directly

python3 setup.py install

Access all SFS commands through the installed script named sfs

mkdir my-first-sfs
cd my-first-sfs
sfs init
sfs add-col my-hdd /media/hdd

You can run tests with nose

nosetests

Work in Progress

  • Saving Changes Made Back to Source

    Any changes made to the organisation of links in an SFS, like deletion, renaming or relocation will be reflected back to the source discs or directories. There will be a number of modes of saving changes:

    • Copy: Files will be copied to an actual directory or drive with the same file hierarchy as some directory in an SFS, the copied files being actual source files from various collections
    • Move: The source files will be moved to a new destination as specified by the SFS file hierarchy and save mapping
    • Delete: Files deleted in an SFS will be reflected back to a collection source or a part of it
    • Save: In this mode, an exhaustive mapping of SFS directories and collection sources will be specified and changes will be reflected in all collections, internally executing Move and Delete on all of them
  • Filtering Files

    SFS will add the ability to filter SFS Files and directories, a feature missing from most file systems. The following filters will be available:

    • Filter by file size
    • Filter by file type
    • Filter by any custom properties
  • Adding Properties to Files and Directories

    It will be possible to add properties to files and directories in an SFS an look them up which can be useful for simply tagging them and can even be used while applying filters

  • Freezing Directories

    Freeze will be a special property that can be applied to directories in an SFS to prevent them from being manipulated by SFS commands like Merge, Filters and De-duplication. This can be useful for hierarchies like project and application directories which must remain intact

Tips

  • Though SFS is all about symlinks and your source files are always safe, it is recommended to back up the SFS root directory before doing anything adventurous. Backing up is as simple is making a copying os the SFS root directory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Symbolic-File-System-2.0.0.tar.gz (22.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Symbolic_File_System-2.0.0-py3.7.egg (65.0 kB view details)

Uploaded Egg

Symbolic_File_System-2.0.0-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file Symbolic-File-System-2.0.0.tar.gz.

File metadata

  • Download URL: Symbolic-File-System-2.0.0.tar.gz
  • Upload date:
  • Size: 22.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for Symbolic-File-System-2.0.0.tar.gz
Algorithm Hash digest
SHA256 5d59556c596dfe10ce38748830c795136a4197e8a8401588b98fda620e4fc028
MD5 d3f6d11f7a4fb4b4a3801409ec757c73
BLAKE2b-256 0e9b12dd19ac54cb68c4a1905eac3b4723466013ac1156fcba77e90292970e51

See more details on using hashes here.

File details

Details for the file Symbolic_File_System-2.0.0-py3.7.egg.

File metadata

  • Download URL: Symbolic_File_System-2.0.0-py3.7.egg
  • Upload date:
  • Size: 65.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for Symbolic_File_System-2.0.0-py3.7.egg
Algorithm Hash digest
SHA256 cf602ab18c9b71fe008de31030a3c1a156b5a60439167e06936ff7c214df95c6
MD5 c41f7f6d7633864aa3b3170bcd2c0616
BLAKE2b-256 e53265a15ec959c30e81bce7369df362e7c029d3b92a455946a99732cdd2f2b4

See more details on using hashes here.

File details

Details for the file Symbolic_File_System-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: Symbolic_File_System-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 30.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for Symbolic_File_System-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12a800c14dfe6d79e4ae56613a4e627f70f21d00c8b32c382cd7f74028b0281a
MD5 9d71c87f678fd6338b9bf429ee66285c
BLAKE2b-256 6edf82adc54f330fc9de5097e291eb06a696027d5f36d26da6db434f51b613ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page