This repository has been archived by the owner on Aug 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgc local.bat
266 lines (223 loc) · 9.33 KB
/
gc local.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
@echo off
title Gclone is the best, batch file edited by Tomyummmm, original by RoshanConnor Yo yo (https://telegra.ph/Gclone-Guide-for-Windows-07-20)
color 0b
echo Hey Sexy! Wanna clone some TBs?
echo ----------------------------------------------------------------------------------------------------------------------
echo Configured Team Drives
gclone listremotes
echo ----------------------------------------------------------------------------------------------------------------------
echo off
:menu
echo.
echo 1) COPY - Copy files from source to dest, skipping already copied.
echo 2) MOVE - Move files from source to dest.
echo 3) SYNC - Make source and dest identical, modifying destination only.
echo 4) SIZE - Return the total size and number of objects in remote:path.
echo 5) CHECK - Check if the files in the source and destination match.
echo 6) LIST
echo 7) DELETE / PURGE - Remove path / contents.
echo 8) DEDUPE - Interactively find duplicate files and delete/rename them.
echo 9) REMOVE EMPTY FOLDERS
echo 10) EMPTY TRASH
echo N) NCDU - Explore a remote with a text based user interface.
echo M) MD5SUM - Produces an md5sum file for all the objects in the path.
echo C) CONFIG - Enter an interactive configuration session.
echo Q) EXIT
echo.
set /P option="Choose your Mode: "
if %option% == 1 (goto copy)
if %option% == 2 (goto move)
if %option% == 3 (goto sync)
if %option% == 4 (goto size)
if %option% == 5 (goto check)
if %option% == 6 (goto list)
if %option% == 7 (goto delete)
if %option% == 8 (goto dedp)
if %option% == 9 (goto rmdi)
if %option% == 10 (goto empt)
if /I %option% == N (goto ncdu)
if /I %option% == M (goto md5)
if /I %option% == C (goto config)
if /I %option% == Q (EXIT)
echo Invalid input!
goto menu
echo.
:copy
echo.
set /P src="[Enter Source Folder / TeamDrive] "
echo ----------------------------------------------------------------------------------------------------------------------
set /P dst="[Enter Destination Folder / TeamDrive] "
gclone copy %src% %dst% --transfers 10 --tpslimit-burst 50 --checkers 10 -vP --stats-one-line --stats=10s --ignore-existing --drive-server-side-across-configs --drive-chunk-size 128M --drive-acknowledge-abuse --drive-keep-revision-forever --fast-list
echo.
pause
goto menu
:move
echo.
set /P src="[Enter Source Folder / TeamDrive] "
echo ----------------------------------------------------------------------------------------------------------------------
set /P dst="[Enter Destination Folder / TeamDrive] "
gclone move %src% %dst% --transfers 50 --tpslimit-burst 50 --checkers 10 -vP --stats-one-line --stats=10s --ignore-existing --drive-server-side-across-configs --drive-chunk-size 128M --drive-acknowledge-abuse --drive-keep-revision-forever --fast-list
echo.
pause
goto menu
:sync
echo.
set /P src="[Enter Source Folder / TeamDrive] "
echo ----------------------------------------------------------------------------------------------------------------------
set /P dst="[Enter Destination Folder / TeamDrive] "
gclone sync %src% %dst% --transfers 50 --tpslimit-burst 50 --checkers 10 -vP --stats-one-line --stats=10s --drive-server-side-across-configs --drive-chunk-size 128M --drive-acknowledge-abuse --drive-keep-revision-forever --fast-list
echo.
pause
goto menu
:check
echo.
set /P src="[Enter Source Folder / TeamDrive] "
echo ----------------------------------------------------------------------------------------------------------------------
set /P dst="[Enter Destination Folder / TeamDrive] "
gclone check %src% %dst% -P --drive-server-side-across-configs --fast-list
echo.
pause
goto menu
:size
echo.
set /P src="[Enter Folder / TeamDrive] "
gclone size %src% --fast-list
echo.
pause
goto menu
:list
echo.
echo 1) ls List the objects in the path with size and path.
echo 2) lsd List all directories/containers/buckets in the path.
echo 3) lsf List directories and objects in remote:path formatted for parsing
echo 4) lsjson List directories and objects in the path in JSON format.
echo 5) lsl List the objects in path with modification time, size and path.
echo 6) tree List the contents of the remote in a tree like fashion.
echo 7) listremotes List all the remotes in the config file.
echo.
set /P listtype="Type of List? "
set /P remote="[Enter Folder / TeamDrive] "
echo.
if %listtype% == 1 (gclone ls %remote%)
if %listtype% == 2 (gclone lsd %remote%)
if %listtype% == 3 (gclone lsf %remote%)
if %listtype% == 4 (gclone lsjson %remote%)
if %listtype% == 5 (gclone lsl %remote%)
if %listtype% == 6 (gclone tree %remote%)
if %listtype% == 7 (gclone listremotes)
echo.
pause
goto menu
:delete
echo.
echo 1) delete Remove the contents of path.
echo 2) deletefile Remove a single file from remote.
echo 3) purge Remove the path and all of its contents.
echo.
set /P deletetype="Type of Delete? "
set /P remote="[Enter Folder / TeamDrive] "
echo.
if %deletetype% == 1 (gclone delete %remote% -vP --stats-one-line --stats=15s --fast-list)
if %deletetype% == 2 (gclone deletefile %remote% -vP --stats-one-line --stats=15s --fast-list)
if %deletetype% == 3 (gclone purge %remote% -vP --stats-one-line --stats=15s --fast-list)
echo.
pause
goto menu
:dedp
echo.
set /P src="[Enter Folder / TeamDrive] "
set /P choice="Do you want to do a dry run? (y/n) "
if /I %choice%==y (goto drd)
if /I %choice%==n (goto nodrd)
echo.
:drd
echo ----------------------------------------------------------------------------------------------------------------------
gclone dedupe --dedupe-mode newest %src% -v --dry-run --fast-list
echo ----------------------------------------------------------------------------------------------------------------------
echo off
echo.
set /P choice="Proceed with Dedupe? (y/n) "
if /I %choice%==y (goto nodrd)
if /I %choice%==n (goto menu)
echo.
:nodrd
echo ----------------------------------------------------------------------------------------------------------------------
set /P choice=Do you want to PERMANENTLY delete the duplicates? (y - Permanent / n - Send to trash bin)
if /I %choice%==y (gclone dedupe --dedupe-mode newest %src% -v --drive-use-trash=false --fast-list)
if /I %choice%==n (gclone dedupe --dedupe-mode newest %src% -v --fast-list)
echo.
pause
goto menu
:rmdi
echo.
set /P src="[Enter Folder / TeamDrive] "
set /P choice="Do you want to do a dry run? (y/n) "
if /I %choice%==y (goto drr)
if /I %choice%==n (goto nodrr)
echo.
:drr
echo ----------------------------------------------------------------------------------------------------------------------
gclone rmdirs %src% -v --fast-list --dry-run
echo ----------------------------------------------------------------------------------------------------------------------
echo off
echo.
set /P choice="Proceed with Removal of Empty Folders? (y/n) "
if /I %choice%==y (goto nodrr)
if /I %choice%==n (goto menu)
echo.
:nodrr
echo ----------------------------------------------------------------------------------------------------------------------
set /P choice=Do you want to PERMANENTLY delete empty folders? (y - Permanent / n - Send to trash bin)
if /I %choice%==y (gclone rmdirs %src% -v --drive-use-trash=false --fast-list)
if /I %choice%==n (gclone rmdirs %src% -v --fast-list)
echo.
pause
goto menu
:empt
echo.
set /P src="[Enter TeamDrive ID] "
echo ----------------------------------------------------------------------------------------------------------------------
set /P choice="Do you want to do a dry run? (y/n) "
if /I %choice%==y (goto emptdr)
if /I %choice%==n (goto emptnodr)
:emptdr
echo ----------------------------------------------------------------------------------------------------------------------
gclone delete %src% -vP --drive-trashed-only --drive-use-trash=false --fast-list --dry-run
echo ----------------------------------------------------------------------------------------------------------------------
echo off
echo.
set /P choice="Proceed to empty trash? (y/n) "
if /I %choice%==y (goto emptnodr)
if /I %choice%==n (goto menu)
:emptnodr
set /P choice="Are you sure? (y/n) "
if /I %choice%==y (gclone delete %src% -vP --drive-trashed-only --drive-use-trash=false --fast-list)
if /I %choice%==n (goto menu)
echo.
pause
goto menu
:ncdu
echo.
set /P src="[Enter Folder / TeamDrive] "
echo ----------------------------------------------------------------------------------------------------------------------
gclone ncdu %src% --fast-list
echo ----------------------------------------------------------------------------------------------------------------------
echo.
goto menu
:md5
echo.
echo ----------------------------------------------------------------------------------------------------------------------
set /P remote="[Enter Folder / TeamDrive] "
echo.
gclone md5sum %remote% --fast-list
echo ----------------------------------------------------------------------------------------------------------------------
echo.
pause
goto menu
:config
echo.
echo ----------------------------------------------------------------------------------------------------------------------
gclone config
echo ----------------------------------------------------------------------------------------------------------------------
echo.
goto menu