用于备份和组织数据的轻量级文件管理器
Symbolic-File-System的Python项目详细描述
SFS(符号文件系统)
一种命令行实用程序,提供了用于组织和备份文件的轻量级设置
sfs存储来自各种源(aka collections)的文件,这些源可能包括目录和
可移动媒体,作为指向源文件的符号链接。
它还存储源文件的元数据,以便以后可以查询文件而无需
插入源媒体。 sfs是一个托管目录,用以下命令初始化: 跨光盘组织数据 SFS的构建动机是能够对存储在
多张光盘,组织视图中的数据并将更改反映回源光盘。这个
是一种轻松的跨光盘组织内容的方式,否则会非常缓慢
有限,因为我们可以同时操作有限数量的磁盘和磁盘间传输
很慢。因为SFS中的所有操作都是在同一个磁盘和符号链接上执行的
它们比重文件快得多 注意:要查看文件的内容,显然需要有可用的源文件。所以,如果
组织文件时需要查看文件内容,需要插入源
可能适合也可能不适合所有用例。但是,sfs使查询
需要访问的SFS文件的源 备份文件 虽然有很多方法可以直接备份目录,但是sfs允许您组织
备份内容的同时,还可能使用一个命令将其保存到多个目标。
例如,在示例中,您可能有一个SFS,在其中添加本地文件(如多媒体和文档)、组织
它们的层次结构类似于存储层次结构,然后将顶级SFS目录映射到备份
使用一个save命令进行备份。你必须定期同步
SFS,对新添加的本地文件进行排序,然后重新运行备份。 分离数据存储和视图
数据通常需要以某种方式存储,这种存储方式可能与您希望的层次结构不同
去看它。SFS允许您创建用于查看内容的虚拟层次结构。例如,假设您
数据保存在许多光盘或目录中,组织为音乐、文档、项目等。您可以选择
要么在本地保存重要文件的副本(我们通常这样做),要么通过
一个搜索你需要的文件,希望没有人会这样做。您可以创建一个sfs实例,
将所有光盘转储到其中,在SFS中为本地文件创建一个目录,并将所有需要的文件复制到
本地系统。您可以在本地搜索所有光盘中的文件,并定期更新要更新的文件
保存在本地系统中 使用pip安装 或者克隆此回购协议并直接运行安装程序 通过名为sfs的已安装脚本访问所有sfs命令
您可以使用nose运行测试 将更改保存回源文件 对SFS中链接的组织所做的任何更改,如删除、重命名
或者重新定位将反映回源光盘或目录。将有
是一些mod保存更改的步骤: 筛选文件 sfs将添加过滤sfs文件和目录的功能,这是大多数
文件系统。将提供以下过滤器: 向文件和目录添加属性 可以将属性添加到sfs中的文件和目录中,并查找它们,这可能非常有用
用于简单地标记它们,甚至可以在应用筛选器时使用 冻结目录 freeze是一个特殊属性,可以应用于sfs中的目录以防止
它们不会被SFS命令(如合并、筛选和重复数据消除)操纵。这个
对于必须保持完整的项目和应用程序目录等层次结构非常有用sfs init
。所有命令
在单个SFS的上下文中执行必须从SFS目录树中运行。
使用命令添加文件sfs add col my_collection/path/to/source
(添加集合)。
SFS文件是指向添加的集合中的源文件的符号链接。外部链接和其他文件可以
也存在于SFS中,但它们不是由SFS管理的,而且通常被忽略。用例
命令
# 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
用法
pip install symbolic-file-system
python3 setup.py install
mkdir my-first-sfs
cd my-first-sfs
sfs init
sfs add-col my-hdd /media/hdd
nosetests
进行中的工作
提示
推荐PyPI第三方库