Speed up resolving step
jsangmeister opened this issue · 3 comments
Is there any possibility to speed up the "resolve" step of pushing/pulling? I manage most of my important files via google drive (probably many thousand, I don't have an exact count) and every time I push/pull I have to wait multiple minutes until everything is resolved. Is there an option to turn on a caching system or something similar?
Hi, may I suggest you to only push/pull the folders with changings? (Unless of course you always edit files pretty everywhere in your drive).
If you're interested I can provide you a simple bash function I use to pull/push multiple folders at same time, this way "parallelizing" the work sensibly speeds up the process. I don't know if this is a good solution, but it's the only one that came up to myself and works fine for me.
Yes, that would be very nice! Only problem with this is that I don't have one folder where everything I regularly use is stored, but multiple, some of which have big subfolders that don't get used often. I didn't find a way yet to specifically pull only the folders I want. Example:
a/
<stuff used often>
b/
<stuff used seldom>
c/
<files and folders used often>
d/
<stuff used seldom>
The problem is that I can't use depth
since I want everything from a
synced, no matter how deep it is. I also can't give explicit file names, because in remote a file might be created which I want to download then. How can I sync a
and c
, but not b
and d
?
Sorry for the late reply.
So here are the two functions I've been using for a while:
dPushAll(){
for i in `ls | grep -v ".desktop"`
do
if [ -s $i ]
then
gnome-terminal -- bash -c "echo -e 'Pushing $i...\n' ; \
drive_linux push $i || (zenity \
--error \
--title 'Drive Error' \
--text 'Something went wrong while pushing on drive, check manually' \
--width 250 ; exec bash)"
fi
done
exit
}
dPullAll(){
for i in `ls | grep -v ".desktop"`
do
if [ -s $i ]
then
gnome-terminal -- bash -c "echo -e 'Pulling $i...\n' ; \
drive_linux pull $i || (zenity \
--error \
--title 'Drive Error' \
--text 'Something went wrong while pulling on drive, check manually' \
--width 250 ; exec bash)"
fi
done
exit
}
grep -v ..
and the if [ -s ..
prevent .desktop and empty files from being processed. I use gnome-terminal but I think you can adapt it to whatever you use.
Briefly explained: gnome-terminal --bash -c ...
launches a new terminal window which will execute the commands in ".." , when a window has been launched for each file/folder from where you called the function the parent terminal will close. In case something goes wrong while pushing/pulling, zenity will produce a popup error message and the corresponding terminal window will be kept open so that you can check. If you don't care about the popup you can just remove the zenity part and leave || exec bash
so that anyway you can notice eventual problems.
This way each window will ask confirmation before taking any action, if you want them to just go you can add the -no-prompt
option.
For your specific use case, the only thing that comes to my mind is to use some convention you decide for often/seldom used files so that you can apply push/pull with the -matches
option