w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Adding arguments to options in Rsync
Are you sure you're exercising the modified rsync? The man page for popt suggests POPT_ARG_INT: Value Description arg Type POPT_ARG_NONE No argument expected int POPT_ARG_STRING No type checking to be performed char * POPT_ARG_INT An integer argument is expected int POPT_ARG_LONG A long integer is expected long POPT_ARG_VAL Integer value taken from CWval int POPT_ARG_FLOAT An float argument is expected float POPT_ARG_DOUBLE A double argument is expected double The man page linked to has only one reference to CWval with no explanation of what it actually means.

Categories : C

cygwin rsync all log locations
You asked if "building file list..." happens in memory, or is stored somewhere. Let's take a look at rsync's sources, namely, flist.c: 2089 rprintf(FLOG, "building file list "); 2090 if (show_filelist_p()) 2091 start_filelist_progress("building file list"); 2092 else if (inc_recurse && INFO_GTE(FLIST, 1) && !am_server) 2093 rprintf(FCLIENT, "sending incremental file list "); 2094 2095 start_write = stats.total_written; 2096 gettimeofday(&start_tv, NULL); 2097 2098 if (relative_paths && protocol_version >= 30) 2099 implied_dirs = 1; /* We send flagged implied dirs */ 2100 2101 #ifdef SUPPORT_HARD_LINKS 2102 if (preserve_hard_links && protocol_ver

Categories : Windows

How to execute bash script after rsync
You can add a command after the ssh command to execute it instead of starting a shell. Add the following after the rsync command : sshpass -p "$password" ssh $host "cd $dir && ./after_deploy.sh"

Categories : Bash

Vagrant Rsync Error before provisioning
Most likely you are running into the known vagrant-aws issue #72: Failing with EC2 Amazon Linux Images. Edit 3 (Feb 2014): Vagrant 1.4.0 (released Dec 2013) and later versions now support the boolean configuration parameter config.ssh.pty. Set the parameter to true to force Vagrant to use a PTY for provisioning. Vagrant creator Mitchell Hashimoto points out that you must not set config.ssh.pty on the global config, you must set it on the node config directly. This new setting should fix the problem, and you shouldn't need the workarounds listed below anymore. (But note that I haven't tested it myself yet.) See Vagrant's CHANGELOG for details -- unfortunately the config.ssh.pty option is not yet documented under SSH Settings in the Vagrant docs. Edit 2: Bad news. It looks as if even

Categories : Amazon

Rsync and ssh on android: No such file or directory
I'm not sure but maybe problem is that the destination path (rajeesh@ is not absolute? Also if you what to sync your files in the same device, maybe you should try to not use ssh? And do something like that: rsync -rvz /mnt/sdcard/some_directory /backup

Categories : Android

boto-rsync multiple credentials
I don't know a lot about boto-rsync but I know it uses boto under the hood and boto supports a BOTO_CONFIG environment variable that can be used to point to your boto configuration file. So, you could have two config files, one with your AWS credentials and one with your Dreamhost credentials and then set the BOTO_CONFIG environment variable to point to the appropriate config file when starting up.

Categories : Amazon

Enabling rsync with ssh keygen and no password
The link that you gave us is right, but there is something that they miss. In the backup-server you must change the file /etc/ssh/sshd_config, uncomment this line AuthorizedKeysFile .ssh/authorized_keys and your no password access should be working. In resume: Client (where you have yours original files) In a terminal write: $ ssh-keygen -t rsa this create the id_rsa.pub file in /home/USER/.ssh/ Server (where you will backup yours files) modify the ssh_config file: #nano /etc/ssh/sshd_config and uncomment the line AuthorizedKeysFile %h/.ssh/authorized_keys and now just copy the content of .ssh/id_rsa.pub(Client) at the end of .ssh/authorized_keys(Server) and the no-password will be working(to connect from Client to Server). Maybe you need to restart your ssh server with /etc/

Categories : Misc

How to use the following piece of rsync command in subprocess call?
You need to invoke the shell with shell=True. However, the documentation discourages using shell=True. In order to avoid using shell=True, you can first create rsync process and pipe it's output to grep: rsync_out = subprocess.Popen(['sshpass', '-p', password, 'rsync', '--recursive', source], stdout=subprocess.PIPE) output = subprocess.check_output(('grep', '.'), stdin=rsync_out.stdout)

Categories : Python

Cross-compiling rsync on OS X 10.8 (64bit) to 10.7 (32bit)
Just found this question: What is the "Illegal Instruction: 4" error and why does "-mmacosx-version-min=10.x" fix it? and the export CFLAGS="-arch i386 -mmacosx-version-min=10.7" ./configure make works. :)

Categories : Xcode

rsync -z with remote share mounted locally
It won't save you anything. To compress the file, rsync needs to read it's contents (in blocks) and then compress them. Since reading the blocks is going to happen over the wire, pre-compression, you save no bandwidth and gain a bit of overhead from the compression itself.

Categories : Linux

Rsync with delete option doesn't seem to work
Assuming you have a recent version of rsync that works the same as on my machine, your command should work. Here's a test example: > mkdir -p site/a > touch site/a/b.txt > rsync -Cr --delete site/ site2 > find site2 site2 site2/a site2/a/b.txt > rm site/a/b.txt > rsync -Cr --delete site/ site2 > find site2 site2 site2/a I suggest you verify a bit more your setup. You might want to test with the above scenario.

Categories : Jenkins

Sending output of 2 rsync commands in a bash script
You may want to put both commands inside the command expansion: rfiles=$(rsync -rvlpogt /svntags/tags/ /var/www/html/ && rsync -rvlpogt /svnbranch/branches/ /var/www/html/)

Categories : Bash

ANT exec task with rsync does not show update output
This is expected behavior. The output of rsync refreshes the same line. For example, it may output: Precent finsihed: 0% Precent finsihed: 1% Precent finsihed: 2% So that the "Percent finished:" part and the percent ("%") will remain still on the screen, while the number changes. However, there are some problem handling such kind of output in Java, check this question: Reading other process' unbuffered output stream Maybe there are some methods to handle such output, but obviously Ant hasn't implemented it.

Categories : Ant

How to modify this rsync command to find out the directory with '.' in Python?
Personally I wouldn't bother using grep, I'd simply use Python's own string filtering - however, that wasn't the question you asked. Since the filenames are remote and Python sees them as simply strings then we can't use any of Python's own file manipulation routines (e.g. os.path.isdir()). So, I think you have three basic approaches: Split each string by slashes and use this to build your own representation of the filesystem tree in memory. Then, do a pass through the tree and only display leaf nodes (i.e. files). If you can assume that files within a directory are always listed immediately after that directory, then you can do a quick check against the previous entries to see if this entry is a file within one of those directories. Use meta-information from rsync. I would suggest th

Categories : Python

How exactly does rsync work? Is it smart enough not to transfer anything if your files aren't different?
Directly from the man page (http://linux.die.net/man/1/rsync): "Rsync finds files that need to be transferred using a lqquick checkrq algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated."

Categories : Linux

Sometimes Rsync fails to copy files from the remote machine
For validation: If you want to check if all files were copied, you can do a simple glob or list for list of files in the remote dir. Then compare to the glob list of files in the target dir. set globResult [ exec rsh -l $user $host "cd $dir; ls -l | wc -l" ] Or if you go further, you can always checksum on both the remote and the target directory. As for the reason for failure, it could've been network or server issues. While you are doing rsync, have you check the return exit status to make sure rsync has completed successfully?

Categories : Perl

How do I use rsync to backup the "/root" folder to a network share?
i assume you run the backup as a normal user and try to backup files that belong to the root user. this will not work because of permission problems. run the rsync command as user root, or gain root privileges temporarily by prepending sudo in front of the command, e.g. sudo rsync -ruvz --no-o --no-g --delete "/root" "/mnt/backup-drive"

Categories : Linux

Show only file names using rsync --recursive on Python?
If you want to skip everything which is below a directory, you can do rsync -avz --exclude '*/' source_directory destination_directory If you want skip all the empty directories, you can use rsync -avz --prune-empty-dirs source_directory destination_directory But it is not clear to me what exactly you want to achieve. You want to skip directories, but not the files in them, where do you want to sync them then if you didn't sync the directory? Or is this just about the output on the screen? If you just want to change the output on the screen, you can pipe it through grep, i.e. rsync -avz source_directory destination_directory | grep "." Then you will only see lines with a .. Note that you have to escape ., as it otherwise stands for a wildcard. Of course, this assumes that you don

Categories : Python

how to pass parameters to Handlebars helper? What's the difference between options.hash & options.data
Parameters passed to a helper become arguments to the helper function. The values you provide in the template immediately after the {{helperName become the arguments. The last argument passed to the helper is an options object that provides additional information to helper like, an options.hash and options.contexts, etc. Key value pairs provided after the parameters correspond to the options.hash property. For a hello helper that takes 3 arguments, the helper would be, Ember.Handlebars.helper('hello', function(a, b, c, options) { return '%@ - %@ - %@'.fmt(a, b, c); }); The hello helper can be used in a template like so, {{hello lorem ipsum dolor}} Here the values of lorem, ipsum, and dolor properties would be used and returned as a combined string. In addition to the required ar

Categories : Ember Js

JComboBox in JTable not displaying options, only the correct number of blank options
After the first while loop navigates across the ResultSet rs the subsequent while loop is never entered as there as no more available records and rs.next() returns false while (rs.next()) { items[count] = rs.getString("parts"); ... } Rather than determine the size of the String array items using a separate loop, use an Vector<String> to build a collection of Strings. This can then be passed directly to the JComboBox constructor after a single navigation of the ResultSet. Vector<String> data = new Vector<>(); while (rs.next()) { data.add(rs.getString("parts")); } count = data.size(); JComboBox<String> jcb = new JComboBox<>(data); As a bonus the count variable equates to data.size()

Categories : Java

Disabling/Removing Select Options created via a Knockout options binding
Not sure if I understand correctly, but it sounds like you're looking for Computed Observables: self.AvailableItemTypes = ko.computed(function() { var selectedTypeIds = this.SelectedItemTypes().map(function(el) { return el.Id; }); return this.ItemTypes().filter(function(el) { return selectedTypeIds.indexOf(el.Id) === -1; }); });

Categories : Knockout Js

Allowed Options in NSJSONSerialization class method dataWithJSONObject:options:error
NSJSONWritingPrettyPrinted is the only option supported at this time. You can provide 0, of course, if you don't want pretty printing. You can find a discussion of it at the bottom of this page. kNilOptions equates to 0, but it's included as part of the Carbon APIs, not Cocoa.

Categories : Objective C

html select control click not showing options list until mouse is hovered towards the options
it seems IE9 is blocking javascript...i hope this helps http://answers.microsoft.com/en-us/ie/forum/ie9-windows_vista/internet-explorer-9-drop-down-menus-do-not-pull-up/954c5c71-5878-40a4-b9f8-68991922e85a

Categories : Javascript

How to count number of files available in a directory recursively in Python using rsync?
I would use a different approach using fabric, which is a great tool for executing remote commands. from fabric.api import run, env env.host_string = 'example.org' output = run('find /tmp -type f | wc -l') num_files = int(output) Now you have the number of files in your variable num_files. I was just using the find command to search for files recursively beginning at directory /tmp, and counted the returned lines with wc -l.

Categories : Python

Excel: Display value from list of options if numbers begin with value from options
VLOOKUP() I believe is the right function for this. Assuming that you want the area names in column E in Sheet1 as from row 2, the phone numbers are in columnB of that same sheet and the table with prefix and area code in Sheet2 columns A and B, you can use: =VLOOKUP(LEFT(B2,5), Sheet2!A:B, 2, FALSE) LEFT(B2,5) extracts the first 5 characters from the phone number stored in B2. If there are area codes of different lengths, then the formula will have to be revised and it will be much more complex. Sheet2!A:B is the table to lookup the data 2 is the index of the column containing the values you want to get (the first index is the column containing the area codes) FALSE means exact match. I don't think you'd like to get the area code immediately smaller than the one you're looking for,

Categories : Excel

RSync works stand alone, not as script in Sublime Text Build System
The Sublime Text console/build system is not interactive, so there is unfortunately no way to enter input during a build. To get around this, you'll either need some other way of authenticating, such as with an SSH key, or you'll need to program a small plugin that uses sublime.Window.show_input_panel() to obtain the password from the user.

Categories : Bash

Default state (Add options) overrides my update options?
If this is a plugin, you need to set the option for the first time with register_activation_hook. If a theme, use after_setup_theme. There's an alternative technique for run_once described in this WPSE Answer that works quite well too. Here's a working example loosely based on yours and some Codex samples using run_once. Note the use of the function checked(). add_action('admin_init', function() { // Change the "init_*" to anything else to `run_once` again if ( wpse_25643_run_once('init_checkbox_default') ) { add_option('my_checkbox_default', true ); } register_setting('media','my_checkbox_default'); add_settings_field( 'my_checkbox_default', 'Checkbox:', 'my_default_checkbox_settings_function', 'media' ); }); funct

Categories : PHP

Using ng-options within a directive and getting options data from injected service
In my opinion, you have several options (as pointed out in the comments): 1. create controller for the directive In you directive's template, use a controller, i.e. <div ng-controller="SelectController"> <!-- your select with the ngOptions --> </div> and create the SelectController as a regular controller: var app = angular.module("app.controllers", []) app.controller("SelectController", ['$scope', 'myDataService', function(scope, service) { scope.options = service.whatEverYourServiceDoesToProvideThis() }]); You can also give your directive a controller, which works just the same: recManagerApp.directive(myDirective, function () { return { restrict: 'E', templateUrl: '/templates/directives/mydirective.html', scope: { m

Categories : Angularjs

Show options of selected options inside the same
If you are looking for a tree view layout using jquery, try this code: $('.tree li').each(function(){ if($(this).children('ul').length > 0){ $(this).addClass('parent'); } }); $('.tree li.parent > a').click(function(){ $(this).parent().toggleClass('active'); $(this).parent().children('ul').slideToggle('fast'); }); Demo and Source: http://www.webstutorial.com/jquery-treeview-list/jquery

Categories : Jquery

GCC compiler options: which set of enabled options is correct?
From GCC documentation: --help={class|[^]qualifier}[,...] Print (on the standard output) a description of the command-line options understood by the compiler that fit into all specified classes and qualifiers. whereas If the -Q option appears on the command line before the --help= option, then the descriptive text displayed by --help= is changed. Instead of describing the displayed options, an indication is given as to whether the option is enabled, disabled or set to a specific value (assuming that the compiler knows this at the point where the --help= option is used) It appears that --help simply shows which options one can enable, while -Q allows one to see if it is actually enabled. Also: The output is sensitive to the effects of previous command-line op

Categories : C

Why Can't I have multiple ng-if options in a select when using ng-options
Basically for 2 options with ng-if = true, the code actually is equivalent to <option value=""> Please Select an Approver Type: </option> <option value=""> Please Select One: </option> Since ngOptions accepts only a single hardcoded option, Optionally, a single hard-coded element, with the value set to an empty string, can be nested into the element. This element will then represent null or "not selected" option. the 1st one will be overwritten.

Categories : Javascript

Options with Options with Python argparse?
In general, I think what you want is impossible because you cannot associate the optional parameter values together. That is, I can't see how to associate --param 12 with --aligner aligner1. However. You can use argparse as follows: p = argparse.ArgumentParser () p.add_argument ("--aligner", action="append", nargs="+") This will create multiple aligner arguments, each requiring at least one argument (the aligner name). You then can use an additional encoding scheme (that you can document in the help text for the parser) which encodes the parameters for each aligner. For example, you could call your script with: ./script.py --aligner aligner1 param=12 --aligner aligner2 param=30 other_param=28 You then split out the additional arguments for each aligner into a list, split by '=' and

Categories : Python

rsync recursively and exclude content of specific directory, not the directory
In recent versions of rsync, you can use the -F option and put a file ".rsync-filter" in the directory src, containing: - dir1/*** That seemed to work for me. I'm assuming that your hierarchy above is all under "src/".

Categories : Linux

Rails 4 search options. What options are available to combine a full HTML site search with an ActiveRecord search?
To rephrase your question, you want to combine results of Google Site Search with custom search results provided by Sphinx, Solr or Elasticsearch? First, you cannot really customize the content of Google Site Search results easily. You can customize the design, and could employ some JavaScript tricks to "merge" its results with another data source, but I'd say the approach is not something maintainable and, more importantly, usable. Notice, that you can display the search results from Elasticsearch with Tire in the same way as ActiveRecord instances, all the usual Rails helpers such as url_for etc. work. The easiest way to evaluate the integration is to generate the example application with the Rails template. If you want to combine the results from ActiveRecord data and the results fr

Categories : Ruby On Rails

jquery TypeError: state is undefined var options = state.options;
<div> <a href="#" id="toggle3">Slide Toggle3</a><br /><br /> <a href="#" id="toggle4">Slide Toggle4</a><br /><br /> <div class="toggle" style="display:none; background-color:#4CF;width:100px;height:200px;"></div> </div> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript"> $(function () { $('#toggle4').click(function () { $('.toggle').hide('1000'); $('.toggle').text('toggle 4 clicked'); $('.toggle').slideToggle('1000'); return false; }); }); $(function () { $('#toggle3').click(function () { $('.toggle').hide('1000'); $('.toggle').text('toggle 3 cl

Categories : Javascript

Feed select options from DB depending on another select options
Just use ajax for this, when one select change fetch data from the server to feed other select. <select class="select_one"> <?php /* render first select ?> </select> <select class="select_two"></select> <script> $(function() { $('.select_one').change(function() { var select = $('.select_two').empty(); $.get('script.php', {region: $(this).val()}, function(result) { $.each(result, function(i, item) { $('<option value="' + item.value + '">' + item.name + '</option>'). appendTo(select); }); }); }); }); </script> and you script.php should return JSON from db: if (isset($_GET['region'])) { $sql = new mysqli('localhost','username','password','database

Categories : PHP

How to get all options of jquery datepicker to instanciate new datepicker with same options?
You can get the options of the existing datepicker using this: var options = jquery('#datepicker').datepicker('option', 'all'); to get one specific option, for example the numberOfMonths: var numberOfMonths = jquery('#datepicker').datepicker('option', 'numberOfMonths');

Categories : Javascript

Why does the getopt method have getopt(args, options[, long_options]) not getopt(args, options,[ long_options]) as its signature?
The function has 2 required arguments (args and options) and one option that is not required (long_options). The exact meaning of args, options and long_options can all be found in the documentation Basically, if you want the commandline to be parsed as: myprogram --foo=bar Then you need to have a long_options list which looks something like ['--foo='], but if you want to parse it as: myprogram -f bar then you would have options set to 'f:'. Of course, you can mix and match as much as you want. For what its worth, I would never recommend anyone use getopt in favor of optparse or (even better) argparse. These later two modules make working with getopt feel like trying to use a hammer to build yourself a new computer ...

Categories : Python

XNA - how to use the same key for different options?
I think you should have different classes for any gameState if they need to have different behaviours. This will ensure you that each Update affect only its own gameState.

Categories : C#

Preg_Replace Options
Just use str_replace()? $string = "PrivateImg-0123456789.jpg"; echo str_replace(".jpg", "[whateveryouwant].jpg", $string); If you must use regex: $string = "PrivateImg-0123456789.jpg"; echo preg_replace("/.(jpe?g|png|gif)$/si", "[whateveryouwant].$1", $string); This will do jpg, jpeg, png and gif, as long as it is the last part. /foo/bar.gif/thisIsWeird wont match

Categories : PHP

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.