A great solution for simple moves.
Since you have said I had a question.
Since your script does not check for similar copies nor file ownership rights, then one might hit a bump when running this code.
How about using existing tools such as RSYNC.
It is optimized for the job of moving resources huge and small also will take care of so many unknowns.
I will post a solution shortly about rsync.
Couple of things the python script did not take notice of are: duplicate files & rights, something else? forgot
the code was well-organized.
Regards,
Hello,
samahani kwa kuchelewa sana kujibu.
People hijacked this discussion already. Doh!!
I have a lot of respect for the authors skills in crafting an elegant script Though, originally the author wrote the moving script using Python, i thought of just using existing tools and hence avoid re-inventing the wheel.
Anyway my 2 cents contribution regarding moving files from one folder to another.
If one needs a really specific task for rsnyc, i could craft it. Rsync is a big and is optimized for so many things, including slow networks.
rsync - a fast, versatile, remote (and local) file-copying tool
important point is try to use opetions 'n' and 'v' for beginners cause it helps to visualize. after confirming the code, remove the -n flag to proceed
Code:
rsync -nrv --delete-after /source /destination
-n : --dry-run flag
simply pretends the move happens but does not make any changes to the system.
in case there is a limit to files need to be moved then command:
--min-size=1.5m
--max-size=1.2m
Code:
rsync -nrv --min-size=1.2m --max-size=1.5m --delete-after /source /destination
--p flag to preserve permissions
Code:
rsync -nrv --p --delete-after /source /destination
--append-verify flag
this will perform a check some verification on the receiving side.
Code:
rsync -nrv --append-verify --delete-after /source /destination
--ignore-exisiting
flag ignores any files in the receiving
Code:
rsync -nrv --append-verify --delete-after /source /destination
--exclude=PATTERN such as: txt;doc;java
--include=PATTERN such as: text;doc;java
Code:
rsync -nrv --exclude=txt;odt --delete-after /source /destination
Code below will only move text and OpenOffice document text files
Code:
rsync -nrv --include=txt;odt --delete-after /source /destination