I got the error below when i'm runnig the following command :
[infadm#etlserver ~]$pmrep backup -o /Prodproject/Backup/bkp_RepProd_$(date +"%Y%m%d").rep -d Desc_bkp_RepProd -f -b -j -q -v
any support please !!
Related
Using bitbucket pipelines to push to our remote from the build process that you get from the pipeline.
This is a snippet of the bitbucket-pipelines.yml file
- pipe: atlassian/ssh-run:0.2.2
variables:
SSH_USER: $PRODUCTION_USER
SERVER: $PRODUCTION_SERVER
COMMAND: '''rsync -zrSlh -e "ssh -p 22007" --stats --max-delete=0 $BITBUCKET_CLONE_DIR/ $PRODUCTION_USER#$PRODUCTION_SERVER:home/$PRODUCTION_USER'''
PORT: '22007'
The connection itself works, and it does run the command correctly once it is remoted onto the server...
INFO: Executing the pipe...
INFO: Using default ssh key
INFO: Executing command on {HOST}
ssh -A -tt -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22007 {USER}#{HOST} 'rsync -zrSlh -e "ssh -p 22007" --stats --max-delete=0 /opt/atlassian/pipelines/agent/build/ {USER}#{HOST}:home/{USER}'
bash: rsync -zrSlh -e "ssh -p 22007" --stats --max-delete=0 /opt/atlassian/pipelines/agent/build/ {USER}#{HOST}:home/{USER}: No such file or directory
Connection to {HOST} closed.
I've tried to run the same command locally from the directory on my machine
ssh -A -tt -i /root/.ssh/pipelines_id -o StrictHostKeyChecking=no -p 22007 {USER}#{HOST} 'rsync -zrSlh -e "ssh -p 22007" --stats --max-delete=0 "$PWD" {USER}#{HOST}:/home/{USER}'
but it just duplicates the home directory on the remote.
It looks to me like it's looking for the source directory on the server and not looking at the docker container from bitbucket (or the files on my local machine with pwd).
If I try to run the command without the '' then it fails because it's using port 22 by default. I've also tried offsetting the command into a bash script and using MODE: 'Script' which is an acceptable pattern for the plugin, but I can't use my environment variables in the sh file.
If all you wan't to do is to copy the files from the pipeline to the production server, you should you the rsync-deploy pipe, instead of the ssh-run. Your pipe configuration is gonna look pretty much like the following:
script:
- pipe: atlassian/rsync-deploy:0.3.2
variables:
USER: $PRODUCTION_USER
SERVER: $PRODUCTION_USER
REMOTE_PATH: 'home/$PRODUCTION_USER'
LOCAL_PATH: 'build'
SSH_PORT: '22007'
Make sure to configure your SSH keys in pipelines properly (here is a link to our docs for configuring SSH keys https://confluence.atlassian.com/bitbucket/use-ssh-keys-in-bitbucket-pipelines-847452940.html)
I've found another way around this instead of needing a plugin, instead I'm running an rsync as a script step
image: atlassian/default-image:latest
- rsync -rltDvzCh --max-delete=0 --stats --exclude-from=excludes -e 'ssh -e none -p 22007' $BITBUCKET_CLONE_DIR/ $PRODUCTION_USER#$PRODUCTION_SERVER:/home/$PRODUCTION_USER
It seems the -e none is an important addition, as is loading in the atlassian image, as fails to find the rsync function, otherwise. I found this info on this post on Atlassian Community.
This seems to work pretty well for me
image: node:10.15.3
pipelines:
default:
- step:
name: <project-path>
script:
- apt-get update && apt-get install -y rsync
- ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
- cd $BITBUCKET_CLONE_DIR
- rsync -r -v -e ssh . $SSH_USER#$SSH_HOST:/<project-path>
- ssh $SSH_USER#$SSH_HOST 'cd <project-path> && npm install'
- ssh $SSH_USER#$SSH_HOST 'pm2 restart 0'
Note: Avoid using sudo cmd in pipeline scripts
same issue with atlassian/default-image:3
rsync -azv ./project_path/*
bash: rsync: command not found
Solution:
apt-get update && apt-get install -y rsync
I want to connect to sybase than execute a file.sql
I tapped this command:
sql -U Login -P MotDePasse -S ServeurASE -d NomDeLaBase -i Script.sql -o JournalDErreur.log
I also tried
isql -U Login -P MotDePasse -S #IPserveur:Port -d NomDeLaBase -i Script.sql -o JournalDErreur.log
and I have the error :
"La commande sql n'est pas reconnue'
Can u help please?
I have installed JTDS and sql (pip install) but it doesn't work
Assuming you're trying to connect to a Sybase ASE database, and you're using the isql command line utility that comes with ASE (or the Sybase SDK), the correct isql format is:
isql -U <login> -P <password> -S <host_or_ipaddr>:<port> -D <dbname> -i <input_script> -o <output_file>
So updating your example we get:
isql -U Login -P MotDePasse -S IPserveur:Port -D NomDeLaBase -i Script.sql -o JournalDErreur.log
I can't speak for your sql example as I'm not familiar with that tool let alone its input parameters.
Error:In FontFamilyFont, unable to find attribute android:fontVariationSettings
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process /sdk/build-tools/27.0.2/aapt with arguments {package -f --no-crunch -I /sdk/platforms/android-26/android.jar -M /project/kitchen33app/milla/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml -S /project/kitchen33app/milla/build/intermediates/res/merged/androidTest/debug -m -J /project/kitchen33app/milla/build/generated/source/r/androidTest/debug -F /project/kitchen33app/milla/build/intermediates/res/androidTest/debug/resources-debugAndroidTest.ap_ -0 apk --output-text-symbols /project/kitchen33app/milla/build/intermediates/symbols/androidTest/debug --no-version-vectors}
Error:com.android.ide.common.process.ProcessException: Error while executing process /sdk/build-tools/27.0.2/aapt with arguments {package -f --no-crunch -I /sdk/platforms/android-26/android.jar -M /project/kitchen33app/milla/build/intermediates/manifest/androidTest/debug/AndroidManifest.xml -S /project/kitchen33app/milla/build/intermediates/res/merged/androidTest/debug -m -J /project/kitchen33app/milla/build/generated/source/r/androidTest/debug -F /project/kitchen33app/milla/build/intermediates/res/androidTest/debug/resources-debugAndroidTest.ap_ -0 apk --output-text-symbols /project/kitchen33app/milla/build/intermediates/symbols/androidTest/debug --no-version-vectors}
Error:org.gradle.process.internal.ExecException: Process 'command '/sdk/build-tools/27.0.2/aapt'' finished with non-zero exit value 1
Error:Execution failed for task ':milla:processDebugAndroidTestResources'.
Failed to execute aapt
Just replace referencing of color code with the actual color in vector drawable files and it should work.
In your app build.gradle add the following line:
defaultConfig{
vectorDrawables.useSupportLibrary = true
}
I need to create a tar and shipped it to my local folder.
If i can create tar file, i can easily get it on local folder using scp.
Here problem is at first step: Creating TAR on remote server. Server is accessible only through another remote server (bastion server).
Here is the command i'm using currently:
timestamp="20160226-085856"
ssh bastion_server -t ssh remote_server "sudo su -c \"cp -r /etc/nginx /home/ubuntu/backup/nginx_26Feb && cd /home/ubuntu/backup && tar -C /home/ubuntu/backup -cf backup_nginx-$timestamp.tar ./nginx_26Feb\" "
Here is the error i am getting:
su: invalid option -- 'r'
Usage: su [options] [LOGIN]
Any help here would be great.
Give it a try without the fancy sudo su -c. Using sudo -s should be enough:
ssh bastion_server -t ssh remote_server "sudo -s cp -r /etc/nginx \
/home/ubuntu/backup/nginx_26Feb && cd /home/ubuntu/backup && \
tar -C /home/ubuntu/backup -cf backup_nginx-$timestamp.tar ./nginx_26Feb"
Or rather set up proper two-hops ~/.ssh/config:
Host bastion
Hostname bastion_server
Host remote
Hostname remote_server
ProxyCommand ssh -W %h:%p bastion
and then just run
ssh remote sudo su -c "cp -r /etc/nginx /home/ubuntu/backup/nginx_26Feb \
&& cd /home/ubuntu/backup && tar -C /home/ubuntu/backup -cf \
backup_nginx-$timestamp.tar ./nginx_26Feb"
Without the fancy escaping and stuff.
I have two servers A and B, I have a shell script in serverA which logs into serverB (through ssh) and runs the following command:
sh cassandra-cli -h <serverB> -v -f database_import.txt;
so when I do this manually, I follow these steps:
serverA:~$ ssh serverB
serverB:~$ sh cassandra-cli -h <serverB> -v -f database_import.txt;
It works properly when I follow these steps manually but when I automate this process in a shell script by this following line:
serverA:~$ssh serverB "sh cassandra-cli -h <serverB> -v -f database_import.txt;"
I get this error,
cassandra-cli: 46: cassandra-cli: -ea: not found
So, as you already pointed out, $JAVA is empty through ssh.
This is because .bashrc is not sourced when you log in using ssh. You can source it like this:
. ~/.bashrc
And your command is going to look like this:
ssh serverB ". ~/.bashrc; sh cassandra-cli -h <serverB> -v -f database_import.txt;"
You can also try placing this into your .bash_profile instead of invoking it manually each time.
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi