OneDrive Multiple Folders/HardDrives Sync - onedrive

I have 3 hard drives. I would like to sync specific folders from each drive with MS OneDrive.
One hard-drive cannot hold all the files from all hard drives.
How can I do this with OneDrive?

What I have done in the past is use symlinks to sync everything to OneDrive, and maintain the folder structure I want. For example, when coding, I like to keep my source folders on the root of C:, so that I can easily access it from menus (C:\coding). So what I'll do is create a folder in OneDrive called coding then symlink it to the root of C: using cmd.exe
mklink /d "C:\Link\Location" "C:\Users\USERNAME\OneDrive\Path\To\Source\Folder"
mklink /d "C:\coding" "C:\Users\USERNAME\OneDrive\coding"
Elevated permissions are required to do this.
You can do this with as many folders as necessary. Just remember, the source folder HAS to be in OneDrive. If you have existing folders that you want to sync, move them all to OneDrive and then symlink them to where they originally were located. Example:
mklink /d "C:\Users\USERNAME\Documents" "C:\Users\USERNAME\OneDrive\Documents"
mklink /d "C:\Users\USERNAME\Desktop" "C:\Users\USERNAME\OneDrive\Desktop"
mklink /d "C:\Users\USERNAME\Favorites" "C:\Users\USERNAME\OneDrive\Favorites"
mklink /d "C:\Users\USERNAME\Desktop\Vacation Pics" "C:\Users\USERNAME\OneDrive\Vacation Pics"
mklink /d "C:\Whatever I want" "C:\Users\USERNAME\OneDrive\Whatever I want"
--edit--
There is also the application Link Shell Extension that I have found extremely useful. Full instructions are found at the link, but... It integrates with Windows' Explorer shell and adds an item to the context menu. You can right click a folder to select it as the symlink source, then left click in the directory you want the symlink to be located. I think it does other things as well, but this is all I use it for. FYI, it requires VCRedist 2005 if memory serves, and does not include that dependency bundled.

For now, MS OneDrive client application only supports one folder. You would need to move all your files into that one folder.
You also cannot use Windows Explorer Libraries as the OneDrive folder - since those are NOT really folders.
Directory links are also not supported in some versions of windows. (http://www.howtogeek.com/174765/how-to-sync-any-folder-with-skydrive-on-windows-8.1/)
The Solution
What I used in the end is SyncDriver - does everything you need from any folder:
http://syncdriver.com/
First you set up the one folder where all the online stuff will go. Then you add any folder - from any drive - and it all goes to OneDrive. Simple and easy to use.
You also have options to only sync in specific directions:
OneDrive => local
local => OneDrive
Bi-Directional

Related

Change Folder Permissions with Terminal

I'm trying to change the permissions of a folder. I want to make a folder, and everything in it restricted to me only; other users can't view it.
The folder, though, contains hundreds of other files in it. Is there a way in Terminal to change the permissions a folder and everything in it? I know this can be accomplished with "Get info" but there's simply too much files inside that folder to manually do that with every file.
I'm running on OS X Mavericks 10.9.5.
Help would be greatly appreciated!
of course there is a way.
You should set the ownership to your user and remove at least the executable flag for the folder. No one will be able to enter the folder via the cd command or the finder, etc.
First change directory to the location where the desired folder is located (its parent folder).
cd path/to/parent/folder
then remove the executable flag for its group (g) and all others (o)
chmod go-x folder
If you also want to make its contents invisible for actions like
ls folder/
then you have to remove the readable flag also.
chmod go-r folder
#micebrain: And there is no need for changing the permissions recursively for all folders and files inside the folder, because you can control the access of opening a folder.
BTW the executable bit (x) - if set - makes files executable and folders openable...

Common wwwroot folder for multiple websites in MVC 6

I have multiple websites which use /wwwroot/assets folder (html theme, css and javascript files) to load the static content.
Currently I am copying assets folder in each site. All of my projects are sitting under a common parent directory.
I don't want to copy the /wwwroot/assets folder into each website. Is there a way to share one assets folder between all sites. May be by providing a direct file system path or something?
At the moment it's not clear from the documentation what sorts of values the webroot key in the project.json file will accept, but so far it would appear that Visual Studio doesn't care for very complicated paths. For example, setting the value to ../wwwroot causes the entry to disappear in the Solution Explorer.
If you look at the kpm code that bundles your project up for deployment, it appears to combine your project's directory with whatever is stored in the wwwroot key, so even though Visual Studio may not understand it, relative paths appear to be supported. Using kpm bundle from the command line confirms this, and a directory above src bundles correctly when using a relative path.
Depending on your particular needs, there is one way that should work that makes kpm and Visual Studio happy, but it will depend on your build environment as to whether that is a good option for you.
Windows, OSX, and Linux all support creating symbolic links for directories, which would allow you to have your assets directory in one location in the filesystem and then create links to it elsewhere. For example, if you had assets in /projects/shared/assets, you could create a link in both of your other projects (e.g. /projects/project1/src/wwwroot/assets) that point to the "real" location.
In Windows, the command would might something like this
mklink /j "C:\link\to\create" "C:\path\to\assets"
So if you did
mklink /j "C:\source\shared\assets" "C:\source\project1\src\wwwroot\assets"
project1 would appear to have an assets directory inside of wwwroot and the build process would be happy since it would appear to each project that the files were local. One thing to note here is that Windows supports a number of different sorts of links. /j specifically creates a junction rather than a true symbolic link. The differences are a bit subtle, but this is a good description of the differences. It is enough to know that if you're working locally, the /j command doesn't require administrative rights and Visual Studio and kpm will both be happy.
In OSX and Linux, the command is similar:
ln -s /link/to/create /path/to/assets
and like Windows, they support different sorts of links.
In any case, under the right circumstances, this might work well without needing any special support from the new ASP.NET project structure, but it would be nice to eventually have that as well.

Move or Copy Files within subfolders to another folder

I've been searching around for quite some time but nothing I've found seems to work for me.
I would really like to move the files to another folder on the same drive if possible just in-case the drive happens to be low on space. but none of the move scripts i found seemed to work for me.
i've tried using move, move-items, copy, xcopy, and even robocopy.
robocopy is the only one to work for me so far even tho its creating a new file, it also creates a subfolder that the file is in. in the new location.
so this how my work looks so far
D:\DVDBD-Projects\Project1\
Movie1\
Movie2\
Movie3\
there is a .mkv file in each movie folder and I would like to move the .mkv in each folder under projects to a new location without creating the folder it was originally in.
So the .mkv files will be moved to D:\DVDBD-Projects\Complete without any folders just mkv files.
This is my code
robocopy "D:\DVDBD-Projects\Project1" "D:\DVDBD-Projects\Complete" *.mkv /s
this will copy the files to the new location but also create the movie1 folder and so on. if i dont use the /s switch it wont look inside the subfolders and copy the files.
So i was hoping you guys could help me out, is there a way that i can copy or move just the .mkv files to the complete folder.
i plan on adding this code to script that encodes the movies from my camera so it saves me alot of point and clicking and cutting and pasting.
*note - looks like i can use this code
pushd "D:\DVDBD-Projects\Project1"
for /r %%a in (*.mkv) do (
MOVE "%%a" "D:\DVDBD-Projects\Complete\%%~nxa"
)
popd
this will take all files from subfolders and move them to the destination folder
i could probably also install xxcopy which extends xcopy which would allow me to copy the files from sub directories without creating new folders in the destination
for /f "delims=|" %%s in ('dir /ad/b') do robocopy "\\source\%%s\" "destination\" *.mkv /s

Move folder structure from one computer to another computer when these computers aren't networked?

I have two computers that aren't networked. I need to replicate the folder structure of one drive that exists on one computer and put it on the other computer. Both Windows 7 machines. I don't need the files, just folders/directories. The drive letters are the same on both computers (Y). The computers are miles apart physically, but I do have access to the computer I am trying to get the folder structure of via LogMeIn.
I am thinking I need to save the folder structure to a file using some process. Move that file to my computer (via email or LogMeIn File Manager) and run some process to put in on my computer.
Is there a better solution? If not, is there code out there to do this via VBA, Cmd window, .bat script, VB.NET, or VBS? I know I can write it in VBA, but I'd rather not recreate the wheel if I don't have to.
I don't have a 'process'/program that does this. LogMeIn File Manager doesn't do this either (I asked). There are lots of paths on this drive that I need so creating them by hand would take a long time. I searched and found a lot of solutions that work with computers that are networked, but these computers are not networked, hence why I think I need to save it to a file. Again, I don't want all the files on the drive (its huge and most of the files are unnecessary), just folders.
thanks.
Create a directory listing of the source computer and redirect the output to a text file:
dir /ad /b /s >> dirlist.txt
The switches to dir are (more info at MS TechNet):
/ad List only files with attribute of directory
/b Bare format (no heading information or summary)
/s Displays files in specified directory and all subdirectories
Transfer dirlist.txt from the source computer to the destination computer.
On the destination computer, use a for /F with that text file from the command prompt to create the directory structure:
for /F "delims=" %i in (dirlist.txt) do md "%i"
The switches to for are documented at MS TechNet
You have many options:
Windows command xcopy source destination /T /E. The /T option creates the directory structure, and the /E option includes empty directories.
Bundle the empty directory structure into an installer (perhaps as a zip file).
If the structure isn't relatively small and not likely to change, you could just put a bunch of md commands into a batch file.
Combination - xcopy the structure locally, zip it, transfer it, unzip it.

Using relative paths for Gnome launcher

We're developing an app that needs to run on a removable device (e.g. USB stick). On Linux, we're using Gnome launchers to place a shortcut to the app on the root of the device. However, we need to use relative paths for the executable and icon since we don't know in advance where the device will mount. In the .desktop file I have something like:
Exec=../myapp/myexecutable
Icon=../myapp/myicon.png
Neither the executable or icon is found. I read the spec on icon lookup in .desktop files (http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#icon_lookup) but it didn't enlighten me.
Is there a way to get launchers to use a relative path? If not, is there another approach to achieve what I want (i.e. a shortcut with an icon and an executable, specified using relative paths)?
Relative paths are not supported*.
One solution is to have an installer. This script updates the desktop file according to the location the script is run from. Make the script executable, and the user can click it to install. The script requires the desktop file to be writable.
This was done with Linux in mind. The file is named autorun.sh; but that is just a convention, it usually won't run automatically. If you deploy this on something other than Linux, then name the file something else(autorun.linux), or adapt it to do different things according to the platform.
#! /bin/sh
#### Fixup $APPNAME.desktop.
APPNAME=xvscatter
ICONNAME=xv_logo.png
cd $(dirname "$0")
APPDIR="$PWD/$APPNAME"
EXEC="$APPDIR/$APPNAME"
ICON="$APPDIR/$ICONNAME"
sed -i -e "s#^Icon=.*#Icon=$ICON#" \
-e "s#^Exec.*#Exec=$EXEC#" "$APPNAME.desktop"
*The convention for the freedesktop is to have the icons in $HOME/.icons, /usr/share/icons or /usr/share/pixmaps. Under those directories are subdirectories for different icon sizes and types. When using one of those directories to store the icon, only the icon name(without the directory) is listed in the desktop file; otherwise record the full path to the file.
The executable, if in the path, can be listed with no pathname(unsafe). It's best to list the full path. Imagine the wrong program getting launched because the full path isn't specified.
Another possibility is to copy the desktop file to the user's desktop or to /usr/share/applications, and edit it there. Do this when the program is on read-only media.
Because none of the above results in a true install, if possible, use the platform's native installer and packaging tools(rpm,dep,portage, etc.). Those tools provide a framework for complete installation including the proper file permissions(think selinux), and desktop menus. They also provide for easy uninstall.
If the program has to run from the removable media, consider using the system install for just installing symlinks, maybe to /opt/vendor/progname.
What I did and worked perfectly was:
Exec=sh -e -c "exec \\"\\$(dirname \\"\\$0\\")/.sh/server.sh\\";$SHELL" %k
Explaining the command:
The snippet below will get the dir name of who is executing that, therefore the launcher dir name
$(dirname \\"\\$0\\")
So appending the desired path, will make this execute relative path.
Ref: https://askubuntu.com/questions/1144341/execute-shell-on-a-relative-path-on-ubuntu-launcher