Foldercopy - quick copy utility for Google Team/Shared Drives with string matches, using rclone (or lclone or gclone)
-
foldercopycopies folders matching anyfilter -
foldercopy also copies shortcuts for folders using
./shcut set_name filter
NOTE: foldercopy requires a local list of folders. Create a set in /sets/ and run ./folderlist set_name to generate / update your list(s). The file is stored in /src_folders and can be updated as often as needed.
Syntax:
-
./folderlist tvgenerates a file listing all folders in the source remotes in the set filetv. Subsequent searches are instant and copying can begin without re-scanning the remote. -
./foldercopy tv Bananaswill copy any folders that include the stringBananas(ignore caps) between folders defined in the set file calledtv -
./foldercopy tv Bananas 2007will copy any folders that include the stringsBananasand2007 -
./foldercopy -d my_remote:comedy tv Bananaswill copy any folders that include the stringBananasto themy_remote:comedyfolder -
flags must come before the set name.
./foldercopy tv Bananas -d my_remote:comedywill NOT work -
After running a command foldercopy will give you a list and a choice
yto copy/sync/move all folders listed.nto abortsto select one of the folders shown in the listcto change or refine the filter
-
Folder
setsmap the source and destination pairs in files in the/setsfolder. These pairs can be as simple or complex as you like. For example a file/sets/tvcould contain
my_td:video bak_td:video
my_td:documentary bak_td:documentary
my_td:nature bak_td:nature
./folderlist tvwill generate a list of all folders in my_td:video , documentary and nature as well as a mapping of all folders to bak_td:. These lists are saved in/src_foldersandsrc_dest_foldersdirectories.- There is a
configfile with a number of basic settings for default folders, actions, etc. - Many settings use flags, and some have short command alternatives. Most short commands accept flags:
FLAG OR COMMAND
-c|--copy) fcopy => copy (This is the default action)
-m|--move) fmove => move
-s|--sync) fsync => sync
-z|--shcut) shcut => create shortcuts of the source folders
fcomp => compare two folder lists
listsets => shows all of your set files. Select to print contentss
-r|--rclone => use rclone (This is the default app for copying)
-l|--lclone) => use lclone
-g|--gclone) => use gclone
-a|--auto) => copy without user confirmation
-t|--test) => print command with executing
-d|--dest) => set destination manually (e.g. -d remote:folder)
-f|--flag) => add a flag to rclone. Each flag requires -f: `-f --flag1 -f flag2`
-u|--update) => update folderlist, then run filter and other commands
foldercopyworks with rclone, gclone and lclone (l3uddz's rclone_gclone fork). This can be set in theconfigfile or with flags- `./listcopy
./fcomp set1 set2creates a file in src_folders listing folders in set1 that are not in set2.fcompwill then ask if you want to copy (or sync or move) those folders.
HINTS:
- searches can use partial and multiple filters
- e.g You have a folderlist called
videoswhich includes a folders called /holiday/2014/italy and /holiday/2015/japan ./fcopy videos hol 14will find/holiday/2014/italy./fcopy videos 201will find/holiday/2014/italyand/holiday/2015/japan./fcopy videos 2014 holidaywill find nothing, as the holiday precedes 2014 in the string
- e.g You have a folderlist called