-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to push/copy a single local file to specific remote directory? #612
Comments
Hello @kevjonesin. Thank you for the question and welcome to drive! My apologies for the late reply. So to push a single file to a specific path is a bit awkward for now, yes in deed. A copy then move doesn't suffice. No one had needed this functionality in the past so I never thought of it. But this is def a good feature to add that will make it easy to move things as opposed to push by relocating to the exact directory structure. To answer some questions:
However for now, you'd have to recreate the directory structure of the target path so $ cp content a1/b2/c3
$ drive push a1/b2/c3 # Or cd a1/b2/c3 && drive push But as you already noticed that quickly becomes unuseable and too much hacking. Thanks for the request, PR coming soon! |
@odeke-em, Thanks for your response and consideration. : } p.s.— I might be able to find time (at some point) to help with documentation. Perhaps expand upon current "help" entries and migrate them to a traditional "man" page and/or "info" page. Would be an interesting way to learn 'man page' format and syntax. win/win Oh, and it occurs to me that basically the functionality I was looking for would pretty much be 'drive' equivalents of "put" and "get" as used with 'sftp'. So, for user familiarity, "put" and "get" might be good command names if you do go ahead and add such arbitrary file handling to 'drive'. |
Added the ability to push directly to a final destination without copying content, remotely/locally nor moving, using option `--destination`. - Sample usage: To push the content of `music/Travi$+Future`, `integrals/complex/compilations` directly to `a1/b2/c3`: ```shell $ drive push --destination a1/b2/c3 music/Travi$+Future integrals/complex/compilations ``` where the sources exist on disk. Fixes #612.
Hello @kevjonesin thanks for the patience. This issue was auto-closed from a PR commit. Please feel free to reopen it if the problem persists. $ drive push --destination a1/few/ones allSources/b2/b3/b5 b8n/logs content/locks/bz9 where the arguments after you've specified the push destination should exist relative to the root of the mounted root dir. |
Keep track of the local vs remote base since we are no longer only pushing from a single location on disk/local. Also ensure that all paths in a push/changelist-resolve are separator prefixed since searching for remote files always starts with '/' as was the old style. Passing in say 'lib/f1' is invalid since the search starts from '/' so must be '/lib/f1'. Fixes #618 Updates #616 Updates #612
Is there a way to push/copy a single local file to specific remote directory? I didn't find any way in "help" docs to specify a remote path or otherwise change remote target directory with "drive push" commands for a single file. And "drive cp" appears to be just for copying remote files to ... well, the "help" docs don't actually specify, but I'm presuming a local path ... or is it to make additional copies within remote directories? I was able to push a file from my local "~/gdrive" directory to my Google Drive's root directory ('My Drive') with "drive push file.txt" and then use "drive mv file.txt Foo/Directory/" to relocate it, but I'm left wondering if there is a way to place a local file of choice in remote directory of choice with a single command? At present, I'm just looking to manually move occasional files to and from my Google Drive via command line, rather than fully syncing remote and local directories.
[BTW, thanks for maintaining and developing "drive"; it's nice to have some GDrive access when I don't have a GUI at hand.]
The text was updated successfully, but these errors were encountered: