Issues with copying a file path with documents to a local Repository Raspberry Pi - bash

I am trying to create a USB stick to be a local Git repository to have a backup of code and automate version control. I have found many articles on how to do this, but I am having an issue copying my documents from my existing folder to a Repo on my local device. Once I have the files on my local device repo, I will clone my repo to another one on the flash drive. I can figure out Git for the most part, lots of documentation. However I am having an issue with copying from my local file system to another local file system Repo. Here is what I am doing:
cd /home/pi/Desktop/Aaron Maker Project/AM_git_controller/
BASH: cd: too many arguments
also when trying to copy the files over:
cp -r home/pi/Desktop/Aaron Maker Project/Code_pack1.1/ ~home/pi/Desktop/Aaron Maker Project/AM_git_controller/
cp: target '~home/pi/Desktop/Aaron Maker Project/AM_git_controller/' is not a directory
I am copy pasting the file paths from file manager, so its not in how I am inputting the file path
I realize this is a very obscure question, this is my first post, anything helps!

Related

Publishing a web site: from a directory tree to server

Does anyone know of a script to publish a web site directory hierarchy to a web server from a local git repo? I'm trying to avoid re-inventing the wheel.
I was thinking the solution could either be scripted visiting file by file or a directory tree using rsync. If scripted file by file, a configuration file would contain tuples; each file to be published and its permissions. This configuration file may also contain path names for folders to be created as well.
Appreciate your guidance.
The solution was to use rsync and ssh with the chmod command to edit permission after syncing the directories.

Update Magento extension using ssh to extract .tgz tar file

I am trying to update a module to a newer version. In the past I have manually uploaded each file carefully into the new directory and overwritten older files using FTP. However I wanted to use SSH to try and do this more easily and without any file permission problems.
I have:
Uploaded the .tgz file to the root folder (/http) on the server
Logged into the server via SSH
Changed the directory to the correct directory
Run the following command: tar -zxvf fishpig_splash.tgz
In the command line I was then given a list of all the files that had been extracted. However if I use FTP to go to any of these files I can see that they are still the older version and have not been overwritten.
I was expecting that the files would extract into the correct directories and overwrite any that already existed. I have tested the extraction by creating a temporary directory and extracting into that and everything worked fine.
Is there another part to this script I need to use to overwrite the files?
Thanks
Glynn
Sorry this was just me being stupid! When extracting the tar file there was a subfolder within it for the extension, I completely missed it. I just went down a level in the file and zipped up the contents only then extracted them at the root and everything worked fine. Thanks for the help though!

Symlink not working when pointing one subfolder to a sibling subfolder

Trying to create a symlink in my hostgator shared hosting account via Jailshell 4.1 and my Mac's Terminal as a test before applying the symlinks to a larger project.
When I try the following it doesn't seem to work:
ln -s public_html/y public_html/x
As I get the following response:
ln: creating symbolic link `public_html/x/y': Permission denied
I am simply trying to set it up so that going to public_html/x will instead take me to public_html/y. My ultimate goal is to later configure many wordpress sites to share a single set of core files without sharing databases, as described here:
http://jason.pureconcepts.net/2012/08/wordpress-multitenancy/
http://jason.pureconcepts.net/2013/04/updated-wordpress-multitenancy/
Edit: Both folders /x and /y already exist, containing a simple index file in each.

Setting up a Git repository on MacOS X with network drive

The given:
A mac with my work folder set up as Git repository.
A network drive (Seagate FreeAgent GoFlex Home, if that helps).
The task:
Set up the specific folder on my network drive as a place where a backup of my repository can be stored.
What I tried:
Setting up the location through Volumes path as a Remote (via Add Remote in Git GUI) - returned with:
fatal: GIT_WORK_TREE (or --work-tree=<directory>) is not allowed without specifying GIT_DIR (or --git-dir=<directory>
Then, I tried
git --git-dir=Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
in the terminal, and though it did not turn up with an error, it does not appear to be of result, as another try to add remote ended with the same error as above.
After that, I started to have doubts if specifying the path to network drive through Volumes and/or trying to add it as remote are the right things to do to solve the task. Maybe there are other ways to accomplish the goal that I am not yet aware of?
I assume you get these errors because nothing exist yet in the network share. A remote must point to an existing repository, so you first have to clone it: in the original repo do:
git clone --bare . /Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
This will copy your repository data to the network folder.
Then you can add it as a remote:
git remote add --mirror=push backup /Volumes/xxxxxxx/GoFlex_Home/Personal/xxxxxxxx
You will be able to synchronize both with:
git push backup

Extra Copy of New Rsync Files

I am attempting to mirror a directory on a remote server using rsync. However, I would like a copy of all newly created files to be stored in a separate directory on the local machine.
For example, if a new file is added on the remote server, I would like it to mirror regularly (for example, to ~/mirror), but save an additional copy of only the new file in another folder, (for example, ~/staging). To be clear, only the new files should appear in staging.
My first approach was to allow rsync to update the timestamps, and then use that to make a copy. However, I would now like to preserve timestamps.
Can anyone provide ideas on a simple approach? I am open to use of additional utilities other than rsync.
You might consider making hardlinks in the extra directory.
ln --force --target-directory=~/staging ~/mirror/*
Edit:
If this is a Linux system, incron will trigger on inotify events and would allow you to make copies of files as they are added to a directory you specify.

Resources