Tag Info

New answers tagged

0

Though correct, I think the above answer is a little incomplete. In order to do both touch and ls as peeradmin user, the rule in /etc/sudoers file should look like: nagios ALL=(peeradmin) NOPASSWD: /bin/ls, /bin/touch If you would like to run more commands, then add those commands (with full path) separated with a comma. Once you do that, just use the ...


3

That's because it's sudo config, and you don't run sudo. sudo su - peeradmin -c "ls" might work. But really, should should be thinking more in terms of using sudo directly if it's just running commands. e.g. sudo -u peeradmin ls For which you'd need an alias: nagios ALL=(peeradmin) NOPASSWD: /bin/ls


0

There seems to be no programmatic way to do this at the moment. Windows uses cipher.exe, which can only encrypt files with the current user certificate. This is the official article for sharing encrypted files by Microsoft. One possible workaround is to encrypt the files with a specific certificate, then export it and distribute it to every machine and ...


0

Just get rid of the continue command, it's not needed. Leave the ;;, though -- that's how the end of a case is indicated. The purpose of continue is to skip the remainder of a loop body, and start the next iteration. It has no meaning outside a loop, so you get this error. This isn't like C/Javascript/PHP -- you don't need a special statement at the end of ...


0

It depends a bit on how you configure Apache to format your access_log. If you're using the common "CLF" logformat: LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog logs/access_log common Then the 7th field contains the request URL. A quick bit of awk which is always present and fairly efficient at parsing text. (Linux almost always has the ...


1

You can try the following: create a file before the job starts and remove it, when it finished. 20 minutes after the job starts check if the file exists. If so then send a notification 00 07 * * * touch /tmp/run_trans_push.started; /u01/home/oracle/sysadm/run_trans_push.sh > /u01/home/oracle/trc/run_trans_push.sh_`date +\%b_\%d`.trc 2>&1; rm -f ...


0

After testing this, it seems that your script should have more mandatory parameters - Add-VpnConnection won't accept just the parameters passed with just your enforced ($Client). When running the "minimal set", the return asks for further details. Add-VpnConnection -Name "Test Name" -AuthenticationMethod MSChapv2 -SplitTunneling -AllUserConnection cmdlet ...


0

You were on the right track with puppet. Have the puppetmaster serve as the source of truth, house them in the server that runs your puppetmaster, and declare the files that should exist and the canonical versions there. You may even want to version the files that you are making available in the puppetmaster server using something like SVN or GIT. This ...


0

I got curious and tried it out: [root@localhost vagrant]# cat test.pp file { '/tmp/path2': ensure => directory, source => 'file:///tmp/path1', recurse => true, purge => true, force => true, } [root@localhost vagrant]# ls -lR /tmp/path1 /tmp/path1: total 4 -rw-r--r-- 1 root root 0 Nov 29 01:55 bar drwxr-xr-x 2 root root ...


3

@dbenham is right on. I'll throw out an alternative. I find the delayed expansion a bit ugly and confusing for longer subroutines, so I'll tend to have a lone call as the "body" of a for loop. Inside the call variable expansion happens "normally". Observe: @echo off setlocal set start=1 set end=500 set interval=100 for /L %%g in (%start%, %interval%, ...


5

This is a classic delayed expansion issue. Type help set or set /? from the command prompt for a discussion about delayed expansion (a bit past half way down the full help). Normal expansion using %var% occurs when the line is parsed. The problem is your entire FOR loop block is parsed in one pass. So you are seeing a constant value that existed before the ...


3

Copy the script to /etc/rc.d/rc.local, reboot and it will run at boot. E.g. [vagrant@localhost ~]$ cat /etc/rc.d/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local sudo touch ...



Top 50 recent answers are included