mkdir -p ./build/brazil-documentation does not create directory and mkdir ./build/brazil-documentation says directory exists - mkdir

I am running into a problem here while writing a script.
When I run the below:
mkdir -p ./build/brazil-documentation
The directory does not get created. However, when I run the below:
mkdir ./build/brazil-documentation
I get an error saying the directory already exists.
What am I doing wrong here?
Any help is appreciated!

Related

rsync --exclude-from=file cannot make the relative path function correctly- how does the exclude from option

I am trying to build a list of files to be excluded.
The absolute path works fine!
But when I try to use the relative path. I get the following error:
rsync: failed to open exclude file exclude-list: No such file or directory (2)rsync error: error in file IO (code 11) at exclude.c(1178) [client=3.1.2]
the exclude-list is the file name.
It is in the source directory at the root
My syntax is
rsync -av --delete --exclude-from='exclude-list' /source /destination
I would appreciate any help
Great! explanation from Gordon Davisson!
I created a new directory
mkdir mydir
moved file into that directory:
cd command into that directory:
ran command from that directory:
IT WORKS!

error:" ln: failed to create symbolic link ‘./sys/kernel/config/nvmt’: Operation not permitted" even with root access

I am trying to setup NVMe over Fabrics using post "https://community.mellanox.com/s/article/howto-configure-nvme-over-fabrics".
I could reach step 10, but when I try to create the soft link according to step 10 as a root user, I am getting error:
ln: failed to create symbolic link ‘./sys/kernel/config/nvmt/subsystems’: Operation not permitted
why creating soft link in /sys/kernel/config as a root user is not possible?
is there any way to get this to work?
Having the same issue, I found that in my case the problem was with the OFED driver.
When trying to run the ln -s command, I would see in dmesg the error:
nvmet: transport type 1 not supported
Following this answer, I reinstalled OFED with the option --with-nvmf, and that allowed setting NVMeoF properly.
Are you including the initial period ('./') in the path? That would say from the current location.
I had similar problem and the reason turned out to be that the directory to be linked must be created BEFORE creating the link. I checked the instructions you are referring to, it seems that they have been updated.
The step you are referring to seems to be step 9 now:
ln -s /sys/kernel/config/nvmet/subsystems/nvme-subsystem-name /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name
This will only work if both /sys/kernel/config/nvmet/subsystems/nvme-subsystem-name and /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name already exist. Now, I don't see the latter folder being created anywhere, so I would try creating that folder:
mkdir -p /sys/kernel/config/nvmet/ports/1/subsystems/nvme-subsystem-name
The -p option enables mkdir to create all the missing directories in the given path if they are missing, so you can directly type mkdir -p a/b/c instead of first mkdir a, then mkdir a/b, then mkdir a/b/c.

Capistrano: cap staging git:check - how to configure ssh path in git-ssh.sh?

I want to figure out how to set the path to ssh in git-ssh.sh file copied to the server by capistrano after executing the deploy command.
Actually the second line of git-ssh.sh looks like:
exec /usr/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no "$#"
I can not execute this command directly on the server. The following error occurs:
[5b4fcea9] /tmp/app.de/git-ssh.sh: line 2: /usr/bin/ssh: No such file or directory
After editing the ssh path to /usr/local/bin/ssh it works well but capistrano will upload this file every time calling cap staging deploy.
See my logs on pastie for more details, specially in the git:check part:
http://pastie.org/9523811
It is possible to set this path in my deploy.rb?
Thanks & cheers
Mirko
Yeah, i got it. :))
Rake::Task["deploy:check"].clear_actions
namespace :deploy do
task check: :'git:wrapper' do
on release_roles :all do
execute :mkdir, "-p", "#{fetch(:tmp_dir)}/#{fetch(:application)}/"
upload! StringIO.new("#!/bin/sh -e\nexec /usr/local/bin/ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no \"$#\"\n"), "#{fetch(:tmp_dir)}/#{fetch(:application)}/git-ssh.sh"
execute :chmod, "+x", "#{fetch(:tmp_dir)}/#{fetch(:application)}/git-ssh.sh"
end
end
end
This line seems to be hardcoded in capistrano source code link here.
Instead of changing capistrano source, why don't you create /usr/bin/ssh symlink on the server? So this:
ln -s /usr/local/bin/ssh /usr/bin/ssh
That will create a /usr/bin/ssh symlink that, when executed, will run /usr/local/bin/ssh.
In your Capfile if you add the following line you can override the git tasks:
require 'capistrano/git'

Drush make directory is not writable

I am running a drush make and getting the following error
Directory /Applications/MAMP/htdocs/geoslate/sites/default exists, but is not writable. Please check directory permissions. [error]
Unable to copy /tmp/make_tmp_1365076314_515d695acefc3/__build__/sites/default to ./sites/default. [error]
Cannot move build into place
I am not an expert on permissions in the terminal, can you give me a hand to give the directory the write permisions. I have tried chmod -w /Applications/MAMP/htdocs/geoslate/sites/default and chmod u+x /Applications/MAMP/htdocs/geoslate/sites/default
chmod +w <directory> solved the problem

Install Tig with sufficient permissions using `make install`

How can I give the command "make install" sufficient permissions to run the following successfully?
[~/tig-0.14.1]# make install
mkdir -p /usr/local/bin && \
for prog in tig; do \
install -p -m 0755 "$prog" "/usr/local/bin"; \
done
mkdir: cannot create directory `/usr/local': Permission denied
make: *** [install] Error 1
I run ./configure and make successfully before the problem.
Either run make install as root, or configure Tig in a directory you have write access to. (Usually with --prefix=<path> to the configure command)