Skip to content

Move a list of directories, possibly piped from find to semewhere else preserving directory tree and attributes.

License

Notifications You must be signed in to change notification settings

dcodix/mv-elsewhere

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

mv-elsewhere

Move a list of directories, possibly piped from "find" to semewhere else preserving directory tree and attributes.

why

Do you know this huge volume with terabytes of OLD data mixed with working data? This script will help moving those files to another location just piping in whatever "find" tells is old.

why not bash?

It is possible to do it with bash, but it gets complicated with some "user named files",... with nice characters... ...And I have to learn python! ;)

use

mv-elsewhere.py -d <destfile> [-m] [-o] [-v] [-D][-e string]

-d: destination directory.
-D: debug.
-e: excluded sting. If file or path contain this string it will be excluded.
-m: move files instead of copy.
-o: override files in case of copy or move.
-v: verbose.

Example:

find testdir -mtime +620  | /usr/local/bin/mv-elsewhere -d testdest -m -e excludestring

TODO

-add possibility to give multiple excludes

-add posibility to read files to process from a file instead of stdin

-add a staristics do nothing option,.. this option will actualy do nothing. Instead it will print what would do.

-add a possibility to contruct a list of files to a file while calculating the space it will take. Reporting the final space needed and the file where the list is.

About

Move a list of directories, possibly piped from find to semewhere else preserving directory tree and attributes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages