Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 61/271 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • How to abort robocopy on first error

    - by Yurik
    When using robocopy windows utility, what flags do I set so that robocopy aborts on the very first error it sees, similar to xcopy /dry command? I need to mirror two dirs, and on occasion some files would be locked. I do not want robocopy to continue trying to copy files, or override the files that are not locked - rather the very first error should stop the whole copy process.

    Read the article

  • How do I teach my linux command line manners?

    - by Sam152
    Whenever I complete something in the command line while using Ubuntu and my computer does something of value to me, I enjoy saying thank you, just because it's the polite thing to do. A typical conversation might look something like this: mtp-sendfile HamishAndyPodcast.mp3 /Music/podcasts Sending file... Progress: 17769768 of 17769768 (100%) New file ID: 76098 sam@sams-laptop:~$ thanks thanks: command not found What's the best way to teach my PC a few manners and respond with something like "No problemo".

    Read the article

  • Can I list file names (or their parent directories) that were recently deleted using rm in OS X?

    - by Andrew Grimm
    Is it possible to find out which files and directories have recently been deleted by rm in OS X? Or failing that, is it possible to find which parent directories have had files or directories within it deleted? The OS version is Snow Leopard. Background: Last night, rvm (ruby version manager) did rm -rf of the ~/ruby directory from the home directory. (This bug has since been fixed) Ideally, I'd like to know what files within the ~/ruby directory were deleted, but failing that, I'd like to know if rvm deleted anything outside of ~/ruby . In case anyone's wondering about backups...: Just about everything within ~/ruby is a git project that has a remote repo, and I have a fairly recent Time Machine backup (only 20 days old).

    Read the article

  • Rename/Move file only if destination does not exist

    - by mikeY
    I would like to know if there is any way a file can be moved only if the destination does not exist - in other words, move only if it does not lead to overwriting. mv --update seemed first to be the solution, however, if the timestamp of the source path is newer than the destination, move will overwrite it and all attempts to circumvent this by modifying the timestamp before the move will fail. I need this behaviour to implement a simple file based lock where existence of a 'lock' file indicates that the lock is acquired.

    Read the article

  • Detect fails in setup script

    - by Lai Yu-Hsuan
    I wrote a setup script to install my prefered programs and settings after I got a new server. apt-get install git git clone http://[email protected] .vim ln -s .vimrc .vim/vimrc ... But if something wrong happens during setup, how can I interrupt the setup script, and log the error(s)? For example, if github server is down, it's obviously useless to create a symbolic link to non-existed vimrc. (or you have a better approach to initialize a server?)

    Read the article

  • How to log error queries in mysql?

    - by Kaizoku
    I know that there is general_log that logs all queries, but I want to find out which query has an error, and get the error message. I have tried running an error query on purpose, but it logs as a normal query and doesn't report it with error. Any ideas?

    Read the article

  • A compression program that handles files with unusual extensions

    - by ripper234
    WAR files are simply ZIP files with a renamed extension. I'd like to configure a compression program to handle these (on double-clicking the file), but jZip doesn't recognize them unless I rename them to .ZIP. I have setup Windows file associations, but jZip just wants to 'add them to archive' instead of opening them. Which compression program would you recommend?

    Read the article

  • FreeBSD rc.d script doesn't work when starting up

    - by kastermester
    I am trying to write a rc.d script to startup the fastcgi-mono-server4 on FreeBSD when the computer starts up - in order to run it with nginx. The script works when I execute it while being logged in on the server - but when booting I get the following message: eval: -applications=192.168.50.133:/:/usr/local/www/nginx: not found The script looks as follows: #!/bin/sh # PROVIDE: monofcgid # REQUIRE: LOGIN nginx # KEYWORD: shutdown . /etc/rc.subr name="monofcgid" rcvar="monofcgid_enable" stop_cmd="${name}_stop" start_cmd="${name}_start" start_precmd="${name}_prestart" start_postcmd="${name}_poststart" stop_postcmd="${name}_poststop" command=$(which fastcgi-mono-server4) apps="192.168.50.133:/:/usr/local/www/nginx" pidfile="/var/run/${name}.pid" monofcgid_prestart() { if [ -f $pidfile ]; then echo "monofcgid is already running." exit 0 fi } monofcgid_start() { echo "Starting monofcgid." ${command} -applications=${apps} -socket=tcp:127.0.0.1:9000 & } monofcgid_poststart() { MONOSERVER_PID=$(ps ax | grep mono/4.0/fastcgi-m | grep -v grep | awk '{print $1}') if [ -f $pidfile ]; then rm $pidfile fi if [ -n $MONOSERVER_PID ]; then echo $MONOSERVER_PID > $pidfile fi } monofcgid_stop() { if [ -f $pidfile ]; then echo "Stopping monofcgid." kill $(cat $pidfile) echo "Stopped monofcgid." else echo "monofcgid is not running." exit 0 fi } monofcgid_poststop() { rm $pidfile } load_rc_config $name run_rc_command "$1" In case it is not already super clear, I am fairly new to both FreeBSD and sh scripts, so I'm kind of prepared for some obvious little detail I overlooked. I would very much like to know exactly why this is failing and how to solve it, but also if anyone has a better way of accomplishing this, then I am all open to ideas.

    Read the article

  • Parse java console output with awk

    - by Bob Rivers
    Hi, I'm trying to use awk to parse an output generated by a java application, but it isn't working. It seems that the command after the pipe isn't able to get/see the data throwed by the java app. I'm executing the following command (with the return generated by the command): [root@localhost]# java -jar jmxclient.jar usr:pass host:port java.lang:type=Threading ThreadCount 06/11/2010 15:46:37 -0300 org.archive.jmx.Client ThreadCount: 103 What I need it's only the last part of the string. So I'm tryng to use awk (with pipe at the end of the line |awk -F ':' '{print $4}': [root@localhost]# java -jar jmxclient.jar usr:pass host:port java.lang:type=Threading ThreadCount|awk -F ':' '{print $4}' But the output isn't being parsed. It throws the entire string: 06/11/2010 15:46:37 -0300 org.archive.jmx.Client ThreadCount: 103 I also tryed to use |cut -f4 -d":" with the same result: the string isn't parsed. So my question is, how do I parse the output in order to get just the number at the end of the string? TIA, Bob

    Read the article

  • Startup script on Ubuntu 12.04 not getting executed. Dependencies / load order.

    - by user861181
    I want to create a simple startup script on Ubuntu 12.04: myscript.sh #!/bin/sh sudo /etc/init.d/nginx start cd ~/app/current god -c config/resque.god sudo /etc/init.d/redis-server start echo "SCRIPT RUN" I have it at /etc/init.d/myscript.sh When I do sudo chkconfig --level 2345 myscript.sh I get myscript.sh 2345 When I do sudo chkconfig --add myscript.sh I get insserv: warning: script 'K01myscript.sh' missing LSB tags and overrides insserv: warning: script 'myscript.sh' missing LSB tags and overrides The script you are attempting to invoke has been converted to an Upstart job, but lsb-header is not supported for Upstart jobs. insserv: warning: script 'dbus' missing LSB tags and overrides .... myscript.sh 0:off 1:off 2:on 3:on 4:on 5:on 6:off ** EDIT:: I checked the boot.log and it turns out that the script is run, but the problem is that god is not loaded yet when the script is executed. Apparently I want to load this script as the very last thing at startup (or somehow check if god is loaded and then start the script).

    Read the article

  • Multiple "My Documents" folders?

    - by Flasimbufasa
    I am having the issue, where, I have 2 folders called "My Documents". I recently edited my registry to make "Document" link in the Windows 7 start menu be a FOLDER link and not a LIBRARY link.. Here is the Registry Key information for the Documents key: Key Name: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7b0db17d-9cd2-4a93-9733-46cc89022e7c} Class Name: <NO CLASS> Last Write Time: 3/2/2011 - 2:33 AM Value 0 Name: Attributes Type: REG_DWORD Data: 0x1 Value 1 Name: Category Type: REG_DWORD Data: 0x4 Value 2 Name: Icon Type: REG_EXPAND_SZ Data: %SystemRoot%\system32\imageres.dll,-1002 Value 3 Name: LocalizedName Type: REG_EXPAND_SZ Data: @%SystemRoot%\system32\shell32.dll,-34575 Value 4 Name: Name Type: REG_SZ Data: Documents Value 5 Name: PublishExpandPath Type: REG_DWORD Data: 0x1 Value 6 Name: PrecCreate Type: REG_DWORD Data: 0x1 Value 7 Name: RelativePath Type: REG_SZ Data: Documents Value 8 Name: Roamable Type: REG_DWORD Data: 0x1 Also, Navigating through computer to "C:\Users\Flasimbufasa\" Only shows one folder called "Documents" However, whenever I navigate to user profile from "Desktop\Flasimbufasa" I get 2 Document folders. Any help?

    Read the article

  • Downloading multiple files with wget and handling parameters

    - by coure2011
    How can I download multiple files using wget? I also want to rename the files. Here are the commands I'm running one by one (copy/paste on terminal): wget -c --load-cookies cookies.txt http://www.filesonic.com/file/812720774/PS11.rar -O part11.rar wget -c --load-cookies cookies.txt http://www.filesonic.com/file/812721094/PS12.rar -O part12.rar wget -c --load-cookies cookies.txt http://www.filesonic.com/file/812720804/PS13.rar -O part13.rar wget -c --load-cookies cookies.txt http://www.filesonic.com/file/812720854/PS14.rar -O part14.rar ........ and so on.. What can I do to download all these files one by one?

    Read the article

  • Copy files from sub directories into one directory.

    - by Derek Organ
    Ok I have a bunch of files in this file structure format. /backup/daily/database1/database1-2011-01-01.sql /backup/daily/database1/database1-2011-01-02.sql /backup/daily/database1/database1-2011-01-03.sql /backup/daily/database1/database1-2011-01-04.sql /backup/daily/database1/database1-2011-01-05.sql /backup/daily/database1/database1-2011-01-06.sql /backup/daily/database1/database1-2011-01-07.sql /backup/daily/anotherdb/anotherdb-2011-01-01.sql /backup/daily/anotherdb/anotherdb-2011-01-02.sql /backup/daily/anotherdb/anotherdb-2011-01-03.sql /backup/daily/anotherdb/anotherdb-2011-01-04.sql /backup/daily/anotherdb/anotherdb-2011-01-05.sql /backup/daily/anotherdb/anotherdb-2011-01-06.sql /backup/daily/anotherdb/anotherdb-2011-01-07.sql /backup/daily/stuff/stuff-2011-01-01.sql /backup/daily/stuff/stuff-2011-01-02.sql /backup/daily/stuff/stuff-2011-01-03.sql /backup/daily/stuff/stuff-2011-01-04.sql /backup/daily/stuff/stuff-2011-01-05.sql /backup/daily/stuff/stuff-2011-01-06.sql /backup/daily/stuff/stuff-2011-01-07.sql And there are lots lots more. ultimately I want to import all the 2011-01-07.sql files into my mysql database. This works for one mysql -u root -ppassword < /backup/daily/database1/database1-2011-01-07.sql That will nicely restore that database from this backupfile. I want to run a process where it does this for all databases. So my plan is to first cp all 2011-01-07 sql files into a tmp dir e.g. cp /backup/daily/*/*2011-01-07*.sql /tmp/all The command above unfortunately isn't working I get an error: cp: cannot stat ..... No such file or directory So can you guys help me out with this. For bonus points if you can tell me how to do the next step which is import all databases in one command doing one at a time that would be great too. I really want to do these in two separate steps because I need to delete a few sql files manually from the tmp dir before I run the restore command. So I need: 1) command to copy all 2011-01-07 sql files to a tmp dir 2) command to import all those files in that dir into mysql I know its possible to do in one but for lots of reasons I really would prefer to do it in two steps.

    Read the article

  • how to change focus-mode: mouse's delay?

    - by Paladin
    how can I change delay before focus when having focus-mode: mouse in gnome 3? I am used to this behaviour from my previous WM (awesome), but I decided to give a Gnome another try (last used was gnome2) and I havem more or less happy so far, only this mouse focus thing is bugging me. I am used to no delay when focusing window under mouse, but I cannot find any setting do to this in gnome3. I so far tried googling, some medling with dconf editor but so far I have no luck in solving this. Any help will be appreciated ^_^

    Read the article

  • What's the difference between sudo su - postgres and sudo -u postgres?

    - by Craig Ringer
    PostgreSQL users peer authentication on unix sockets by default, where the unix user must be the same as the PostgreSQL user. So people frequently use su or sudo to become the postgres superuser. I often see people using constructs like: sudo su - postgres rather than sudo -u postgres -i and I'm wondering why. Similarly, I've seen: sudo su - postgres -c psql instead of sudo -u postgres psql Without the leading sudo the su versions would make some sense if you were on an old platform without sudo. But why on a less than prehisoric UNIX or Linux would you use sudo su ?

    Read the article

  • why the output of ls is like this

    - by dorelal
    I am using snow leopard and this is what I get in my terminal. By default I am using bash. > ls c* clock: PSD demo.html jquery.tzineClock script.js styles.css clock2: clojure-presentations: Clojure-1up.pdf ClojureInTheField-1up.pdf license.html Clojure-4up.pdf README ClojureForRubyists-1up.pdf keynote coffee-script: Cakefile README bin examples index.html package.json test LICENSE Rakefile documentation extras lib src vendor

    Read the article

  • Terminate child processes on ctrl-c

    - by jackweirdy
    In tiny core linux, I have the following script: #!/bin/sh # ~/.X.d/freerdp.sh rdp(){ while true do xfreerdp -f [IP Address] done } rdp & It's pretty simple; when X starts up and checks the .X.d directory (as is the case in tiny core) it finds and executes this script. The script starts up freerdp and keeps a connection open to the server by restarting it whenever it closes. As you can see from the rdp & line, the function is run in the background to allow X to continue its startup routine. The problem is that whenever I cancel X with a Ctrl-Alt-Backspace the rdp process doesn't die. I'm looking for a way to kill the process as soon as X finishes, either through: A) a script, executed on X closing, which kills the process or B) by modifying the script to check the return value of the xfreerdp command. NB - if the solution does check the return value, it must only end if the command fails to open the X display. For that reason, if you could point me to a reference for xfreerdp return values I'd be grateful.

    Read the article

  • How to reliably keep an SSH tunnel open?

    - by Peltier
    I use an SSH tunnel from work to go around various idotic firewalls (it's ok with my boss :)). The problem is, after a while the ssh connection usually hangs, and the tunnel is broken. If I could at least monitor the tunnel automatically, I could restart the tunnel when it hangs, but I haven't even figured a way of doing that. Bonus points for the one who can tell me how to prevent my ssh connection from hanging, of course!

    Read the article

  • How to conform to update-rc.d with LSB standard?

    - by user34881
    This is a migrated question from stackoverflow, as I was told, this is the place for it to be. http://stackoverflow.com/questions/2263567/how-to-conform-to-update-rc-d-with-lsb-standard I have set up a simple script to back up some directories. While I haven't had any problems setting up the functionality, I'm stuck with adding the script to rcX.d dir's using update-rc.d. My script: #! /bin/sh ### BEGIN INIT INFO # Provides: backup # Required-Start: backup # Required-Stop: # Should-Stop: # Default-Start: 0 6 # Default-Stop: # Description: Backs up some dirs ### END INIT INFO check_mounted() { # Check if HD is mounted } do_backup() { if check_mounted; then # Some rsync statements. fi } case "$1" in start) do_backup ;; restart|reload|force-reload) echo "Error: argument '$1' not supported" >&2 exit 3 ;; stop|"") # No-op ;; *) echo "Usage: backup [start]" >&2 exit 3 ;; esac : Using update-rc.d backup start 10 0 6 . I get the following warnings and errors: update-rc.d: warning: backup start runlevel arguments (none) do not match LSB Default-Start values (0 6) update-rc.d: warning: backup stop runlevel arguments (0 6.) do not match LSB Default-Stop values (none) update-rc.d: error: start|stop arguments not terminated by "." The syntax I try to use is the following: update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] . Google wasn't that helpful at finding a solution. How can I correctly set up a script and add it via update-rc.d? I'm using Ubuntu 9.10. UPDATE Using update-rc.d backup start 10 0 6 . stop 10 0 . the error disappears. The warnings about default values persists: update-rc.d: warning: backup start runlevel arguments (none) do not match LSB Default-Start values (0 6) update-rc.d: warning: backup stop runlevel arguments (0 6 0 6) do not match LSB Default-Stop values (none) It even is added to the appropiate rcX-dirs but it still does not get executed...

    Read the article

  • What is the difference between executing script using Cygwin and PuTTY?

    - by Lily
    Now I get a script.sh, previously it was executed using PuTTY provided it was written in VMWare, but now I want to execute in Windows using Cygwin, I already copy the script.sh out to the corresponding directory, but some commands Cygwin can not recognise. generate(){ date +%T } TIME = generate() echo " Current Time: $TIME" After execute in Cygwin script.sh: line 3: syntax errot neat unexpected token '$'<\r'' script.sh: line 3:'generate<><

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >