Custom `rsync` command to sync my Documents and Dropbox? - dropbox

This is what I want to achieve:
Dropbox Directory Structure:
Dropbox/
1passwordstuff
Music
documentfolder1
documentfolder2
Documents Structure:
Documents/
documentfolder1
documentfolder2
Then, I want to do all of my work within the Documents folder. So let's say I make some changes to a file in documentfolder1, then I want to call a command like rsync ... and have all of my changes pushed into Dropbox. I've managed to achieve this with rsync -r --ignore-existing Documents Dropbox but there's a problem. Let's say I delete some files in Documents/documentfolder1/somefile then I want those files in my Dropbox folder to also get deleted. I don't know how to do this.
Any help?

Voted to close, since this question isn't programming-related, but I think you want rsync --delete.

Why not simply use the symbolic links?
Create a symbolic link in the dropbox folder to the Documents folder, and everything will get synced, and you still will work in your Documents location.
just go to your dropbox folder and run
ln -s PATH_TO_DOCUMENTS Documents

Related

Github in Parent Directory of Google Colab

I'm a noob to Google Colab and Python. I'm attempting to import a custom set of scripts from a Github directory. I'm using the following:
!git clone https://github.com/theAIGuysCode/tensorflow-yolov4-tflite.git
By default, this will export to a folder that it names based on the git name. However, the functions in the needed scripts call the parent directory and not the git folder name. Example:
Google Colab Screenshot
Is there a method for importing the git in the parent directory so the scripts can run without modifying the file hierarchy in each script?
The error is that you are in a different directory. Most likely current directory is /content/ if those two cells in the picture are on top.
You need to change directory before you can call save_model.py, then it will work as expected. Use !pwd to know the current directory.
Before the last cell change directory to the one where desired code is. So in this case it can be,
%cd "/content/tensorflow-yolov4-tflite"
If you are unsure about path, right click on folder and select Copy path to use with cd command.

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...

Playframework - Uploadfile to 2 different folders

just starting at play, and I needed to see it it can be used to do my project.
But after reading some docs, I still can't find a way to put uploaded files in more then one place.
I know that there is the attachments folder, and that I can change it directory in the confs, but what I want is another attachments folder, some thing like:
If the user upload a photo it would go to /photos folder;
if the user upload a txt it would go to /docs fodler;
Thanks
--UPDATE--
I'm using Play 2.0.1
So after some more research I found this other question:
How can I change uploaded files directory in play 2.0.1?
Basically there is no more attachments path configure in this playframework version, so I need to put this manually in the control, just like the answer in that question.

Need to change permissions for a file/folder

In the diagnostics sections in textpattern, it's giving me the error:
"File directory path is not writable:...html/textpattern/files" (took out beginning of path)
I changed the permissions for the textpattern folder, and the folder named "files", which is in the root folder not in the textpattern folder, but it's still giving the error. Do I need to change permissions for all enclosed items of the textattern folder and not just the folder itself?
Maybe I got you wrong but I suppose you simply have to change the path to the files folder in your admin panel from "…html/textpattern/files" to "…/html/files".
Assuming you're on a *nix system...
It sounds like you want to change the permissions recursively.
A quick fix might be to change the permissions like so:
chmod -R 777 html/textpattern
This command will go through every folder and file and change its permissions (the -R turns on the recursive bit).
Warning, this is very broad and not a good idea for production.
A better approach would be to change the permissions at a finer level of granularity. Google for "Linux file permissions" or type man chown at the shell.

How to control file permissions in CVS repository?

Currently some users have their umask set in ways which result in execute permission on regular files, which I'd like to avoid.
Is there a way to force all files checked in to only be read with some exceptions?
What is the recommended way to handle this in CVS?
Cvs command option watch is also preventing file permissions to be restored. If watched, when file is checked out it will be read-only. From cvs man pages:
$ cvs watch --help_options
Usage: cvs watch {on|off|add|remove} [-lR] [-a <action>]... [<path>]...
on/off: turn on/off read-only checkouts of files
So, use cvs watch off filename to remove checkout from repository making it read only every time.
I am not sure if this is the best solution, but I would probably do something with the cvswrappers file in CVSROOT directory of the repo, using commitinfo, commitcheck and commit_prep.pl. If you don't have commit_prep.pl, you can use something like this one:
http://opensource.apple.com/source/cvs/cvs-29/cvs/contrib/commit_prep.pl
There are quite a few examples on the web, so just search for those commit* files if you don't already have those in your repo.
Note that, as this post suggests, the permission is really set only during the first commit of a file, after that, you'd need to "manually" modify the permission on the repository itself.
How do I add execute permission to a file in CVS after it's already been checked in?
In commit_prep.pl, you can clear the exec permission using chmod ugo-x , before the file is committed for the first time.
This solution assumes you are using linux.