How to rsync a remote folder with updated files with a local folder that is also updated? - rsync

I rsynced a folder from an old server to a new server.
Now I want to do it again after a few days, the problem is that both folders (new and old) have been updated by this point. Their files were updated differently, some new folders (different on both) inside the rsynced folder were created...
Now I want the new server to have the same folder as the old server but I don't want to rm the folder and rsync again because it has a lot of GBs.
Is "--update" sufficient here?

Related

Artifactory cleaning up temp folder

I have a question related to Artifactory Jfrog..
Is it safe to delete files in /var/opt/jfrog/artifactory/temp folder?
Taking up a lot of spaces
Thank you
The temp folder is generally safe to delete as Artifactory uses it as a staging area for various indices it creates and for other generated files.
take care with a folder called artifactory-uploads if its present - that is the staging area for ui-originated uploads so you might end up deleting a file that represents an upload in progress, so only delete old files from that location.

Remove file from Git without deleting them locally and remotely

I have a repository for a Wordpress intall that currently has all the Wordpress files included.
I have updated my .gitignore to only include the theme folder but when I push to my staging server it deletes all the files.
I need to keep all the files both locally and on the server, but I want them to stop being tracked and removed from the repository, Ideally with the history still intact.
Thanks in Advance
The server has a copy of the repository, so if you remove anything from the repository it will be removed from the server's repository as well (after you push).
However, you can set git to assume the files are unchanged. This will keep them in the repository, but git will stop detecting new changes to them.

Creating temporary files in wwroot folder ASP.Net MVC3

I have developed an application in which some pdf reports are generated in a temporary folder. The temp folder is located inside the wwroot folder. Now, sometimes the session gets destroyed as soon as a pdf is generated.
Is this caused due to temp file generation ? Should the temp folder be outside wwroot folder ?
Yes, you should place that folder outside the root folder.
The reason your session gets destroyed is because IIS restarts the application when 15 files are modified. An easy workaround is to create a virtual directory in IIS, pointing to a folder outside the root and then write the files to that directory.
That way, your website doesn't need any hard references to a folder but can use MapPath to map the virtual directory to a physical folder
Why not use the App_Data folder? It's much more simple and you will not have this kind of problem.
I finally added a folder outside the wwwroot folder, linked it via virtual directory which solved the problem.

download directory and sub directories off a virtual repository

Wondering if there is a way to download the root folder plus a bunch of sub folders (and sub folders of those folders) with all the files and keep them in their respective folders.
I've tried some firefox plugins like flashgot and download-them-all but they grab the actual web files in addition to the files in the repository, but only if they are visible. For example, if I don't collapse all the folders and expose the files in the repository, the plugins won't detect them.
I would just collapse all the folders and expose the files but these plugins won't recognize the folders...they just download as "foldername".html .... and all the files are mixed together in one folder.
I've also tried visualWget and allowed recursive downloads but again, this only grabs the actual website files, not the files in the repository.
If anyone could help it'd be greatly appreciated. I've been copying them manually but there are literally thousands of files and folders so I'm looking for a quicker solution.
As a client you can only download what's accessible. You either need to know the list of files or crawl the pages for the links, which is what the Firefox plugins do.
There's no way to get a list of files on the server without access to the server beyond http (unless the server has webdav or exposes some other api).
I ended up getting it to work. I used the following command in Terminal.
scp -r username#hostaddress:/file/path/to/directory /path/to/my/computer/directory
-r is for recursive so it downloads all files and directories and subdirectors
If you try this be sure to run this command from your local terminal. I made the mistake of doing it from the SSH connection to the server (no negative effects just frustrating)

How do I move a Perforce "workspace" folder?

I've just downloaded a 4.5GB depot to a location on my hard drive that is not ideal.
I'd like to move the folder that Perforce now sees as the "workspace" folder (iPhone) to another folder on my hard disk (Project Name), and then use that folder as the workspace folder.
Is this possible, or do I need to download the entire depot again?
Thanks,
Dave
in the P4V application:
Open the Workspace dialog:
Go to Connection>Edit Current Workspace...
change "Workspace root:" to where you like
If you have not already moved the files, P4V will offer to copy them for you.
As long as you know what changelist you last synced to, you can do this without having to sync again. Here's how:
Note the last changelist synced
Copy/move the folder to the new location
Update your workspace (either the root, or the depot mapping) to point at the new location
Run p4 flush //depot/path/to/folder/...#<last_changelist>
The flush command tells the server that you have the files at the path specified, at the changelist specified. It's a synonym for p4 sync -k.
Mike's answer is almost correct, except that the p4 sync -k is not required when moving a workspace (changing the root). P4 does not care where the root is, it only tracks the files on your machine by workspace/client name.
If you wanted to change the workspace name (which would require you to create a new workspace) and populate it with files from an already synced workspace, you would then need to run p4 sync -k to let the server know that this new workspace has these files at #changeset.
If you are using any client (ie: P4V), then you can edit workspace and change the root to the new workspace path.

Resources