I am trying to upload files from my local computer to a server via ssh for deployment. In the upload, I want to exclude some files like .pyc and BUILD.
I have managed to exclude all the files, but the ones called BUILD.
This is currently my (dry-run) terminal command:
rsync -e ssh --dry-run \
--recursive --archive --verbose \
--delete \
--exclude='*.pyc' \
--exclude='*.scss' \
--exclude='__*.js' \
--exclude='*BUILD' \
--exclude='*.jar' \
--exclude='*.DS_Store' \
--exclude='__pycache__' \
local_folder/ \
server:server_folder/
All the exclusions work, except BUILD.
I tried:
--exclude='*/BUILD'
--exclude='*BUILD'
--exclude='BUILD'
None of the previous seems to have detected and deleted the existing BUILD files.
Any ideas on how I can exclude these files?
Thank you!
The command seems to be working but could be that the BUILD files already existed previously.
If you have excluded files or directories from being transferred, --delete-excluded will remove them from the destination side, so this should work:
rsync -e ssh --dry-run \
--recursive --archive --verbose \
--exclude='*.pyc' \
--exclude='*.scss' \
--exclude='__*.js' \
--exclude='*BUILD' \
--exclude='*.jar' \
--exclude='*.DS_Store' \
--exclude='__pycache__' \
--delete-excluded \
local_folder/ \
server:server_folder/
To complement check also this answer which explain the delete options in rsync https://superuser.com/a/156702/284722
Related
Just wondering if anyone has found a work around for this. Using --exclude using a full file path to a swift file and Jazzy still includes this file / class in the documentation. Shell file looks like this
jazzy \
--clean \
--author "Author" \
--copyright "Copyright" \
--xcodebuild-arguments '-project,jazzytest.xcodeproj,-scheme,jazzytest' \
--exclude /Users/<username-here>/desktop/jazzytest/jazzytest/source/swift1.swift \
--min-acl public
I'm running into an odd behavior on the latest version of vagrant in a Windows7/msys/Virtualbox environment setup, where after executing a vagrant up command I get an error with rsync; 'file has vanished: "/c/Users/spencerd/workspace/watcher/.LISTEN' doing the provisioning stage.
Since google, irc, and issue trackers have little to no documentation on this issue I wonder if anyone else ran into this and what would the fix be?
And for the record I have successfully build a box using the same vagrant file and provisioning script. For those that want to look, the project code is up at https://gist.github.com/denzuko/a6b7cce2eae636b0512d, with the debug log at gist.github.com/
After digging further into the directory structure and running into issues with git pushing code up I was able to find a non-existant file that needed to be removed after a reboot.
Thus, doing a reboot and a rm -rf -- "./.LISTEN\ \ \ \ \ 0\ \ \ \ \ \ 100\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ " did the trick.
Well i have a pipeline which runs some data for me with the help of a makefile.
This pipeline creates an enormous amount of redundant files which i want to clean.
I have 1 makefile to run the pipeline. And the pipeline itself is connected to much other makefiles. so i added this code to the pipeline chipcap.mk file:
.PHONY cleanintermediate
cleanintermediate: $(CHIPCAP_OUTPUT)
rm -rf $(SAMPLE)clipsync.trimsync.fastq
rm -rf $(SAMPLE)clipsync.fastq
rm -rf $(SAMPLE)clip.fastq
rm -rf $(SAMPLE).fastq
rm -rf $(SAMPLE).wig && $(RM) -rf $(SAMPLE).wig.idx
rm -rf $(SAMPLE).sam
Now i run my file like this make -f run_samples.mk
This script will invoke the pipeline and start running all samples separately the command that run_samples.mk gives to the pipeline is:
all: pool1_negCTRL pool1R2R1 pool1SP1 pool2Posctrl pool2R2R2 pool2Input
getCommand = $(MAKE) -f /data/DIV5/SASC/project-064-ronald-svdz/analysis/pipelines/chipcap/chipcap.mk \
IN_DIR=/data/DIV5/SASC/project-064-ronald-svdz/input/$(1) \
OUT_DIR=/data/DIV5/SASC/project-064-ronald-svdz/analysis/runs/$(2) \
CHIPCAP_VER=0.1.2 \
FASTQ_EXT=fastq \
CHIPCAP_INPUT=$(3) \
CHIPCAP_QC_MODE=cliptrim \
GZIP_EXT=gz \
MACS14_EXE=/home/sajvanderzeeuw/.virtualenvs/ronald/bin/macs \
PYTHON_EXE=/home/sajvanderzeeuw/.virtualenvs/ronald/bin/python2.7 \
OPT_MACS14_mfold=$(4),$(5)
#OPT_MACS14_control=control.bam
#Negative control sample
pool1_negCTRL:
$(call getCommand,pool1,pool1_negCTRL_monday_test,pool1-negCTRL_S1_L001_R1_001.fastq.gz,15,30)
How can i say to run_samples.mk that also cleanintermediate(which is in chipcap.mk) should be executed. I've been puzzling a lot but cant find the right way to do it.
cleanintermediate: $(CHIPCAP_OUTPUT)
in chipcap.mk should become cleanintermediate: all
In runchipcap.mk add cleanintermediate to getCommand
getCommand = $(MAKE) -f /data/DIV5/SASC/project-064-ronald-svdz/analysis/pipelines/chipcap/chipcap.mk \
IN_DIR=/data/DIV5/SASC/project-064-ronald-svdz/input/$(1) \
OUT_DIR=/data/DIV5/SASC/project-064-ronald-svdz/analysis/runs/$(2) \
CHIPCAP_VER=0.1.2 \
FASTQ_EXT=fastq \
CHIPCAP_INPUT=$(3) \
CHIPCAP_QC_MODE=cliptrim \
GZIP_EXT=gz \
MACS14_EXE=/home/sajvanderzeeuw/.virtualenvs/ronald/bin/macs \
PYTHON_EXE=/home/sajvanderzeeuw/.virtualenvs/ronald/bin/python2.7 \
OPT_MACS14_mfold=$(4),$(5) cleanintermediate
#OPT_MACS14_control=control.bam
I have a problem with my spec file. When I run it with rpmbuild it says it can't find ./configure no such file or directory. Here is a part of the code of my spec file. Can someone help me?
...
BuildRequires: gd-devel > 1.8, mailx, libjpeg-devel, libpng-devel
Requires: httpd php53 gcc
%description
Nagios is a program that will monitor hosts and services on your
network.
%package common
Group: Applications/System
Summary: Provides common directories, uid and gid among nagios-related packages
Requires(pre): shadow-utils
Requires(post): shadow-utils
Provides: user(nagios)
Provides: group(nagios)
%description common
Provides common directories, uid and gid among nagios-related packages.
%prep
%setup -q -n %{name}-%{version}
%build
%configure \
--prefix=%{_datadir}/%{name} \
--exec-prefix=%{_localstatedir}/lib/%{name} \
--with-init-dir=%{_initrddir} \
--with-cgiurl=/%{name}/cgi-bin/ \
--with-htmlurl=/%{name} \
--with-lockfile=%{_localstatedir}/run/%{name}.pid \
--libdir=%{_libdir}/%{name} \
--with-nagios-user=nagios \
--with-nagios-grp=nagios \
--bindir=%{_sbindir} \
--libexecdir=%{_libdir}/%{name}/plugins \
--sysconfdir=%{_sysconfdir}/%{name} \
--localstatedir=%{_localstatedir}/log/%{name} \
--datadir=%{_datadir}/%{name}/html \
--with-gd-lib=%{_libdir} \
--with-gd-inc=%{_includedir} \
--enable-embedded-perl \
--with-perlcache \
...
I am not familiar with nagios, but have you confirmed that when you extract the distribution tarball, there is a configure file in the top-level directory? If not, you need to add the steps to get there.
I'm thinking about installing magento in automatical way. I suppose that I need to create some script or something... but I guess I'm not first person whom need it. So do you know about any good resource or solution how to it? It would work in Windows and Linux OS. Thanks. Jaro.
There are probably others out there but here is a quick and dirty script I use form time to time to install Magento checkout my svn repo and initialise modman. It could be extended to create database if required etc, but it works fine for me as is:
#!/bin/bash
# Required Script Variables
DB_NAME=
DB_USER=
DB_HOST=
DB_PASS=
URL=
MAGENTO_VERSION="1.7.0.0"
ADMIN_FIRSTNAME=
ADMIN_SURNAME=
ADMIN_EMAIL=
ADMIN_USER=
ADMIN_PASS=
SVN_REPO=
# Download and install Magento
wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz
printf "\n\nUnpacking and preparing to install Magento...\n"
tar -zxvf magento-$MAGENTO_VERSION.tar.gz
mv magento/* magento/.htaccess .
chmod -R o+w media var
chmod o+w app/etc
rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
rm -rf magento/ magento-$MAGENTO_VERSION.tar.gz
printf "\n\nInstalling Magento...\n"
/usr/local/bin/php -f install.php -- \
--license_agreement_accepted "yes" \
--locale "en_GB" \
--timezone "Europe/London" \
--default_currency "GBP" \
--db_host "$DB_HOST" \
--db_name "$DB_NAME" \
--db_user "$DB_USER" \
--db_pass "$DB_PASS" \
--url "$URL" \
--use_rewrites "yes" \
--use_secure "no" \
--secure_base_url "" \
--use_secure_admin "no" \
--skip_url_validation "yes" \
--admin_firstname "$ADMIN_FIRSTNAME" \
--admin_lastname "$ADMIN_SURNAME" \
--admin_email "$ADMIN_EMAIL" \
--admin_username "$ADMIN_USER" \
--admin_password "$ADMIN_PASS"
# Setup svn and modman
modman init
mkdir .modman/modules
svn co $SVN_REPO .modman/modules
modman update-all