I'd like to define some local variables in a cron entry so that I can create the following file /usr/local/etc/cron.d/rsync with the following contents:
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
excludes="--exclude=/storage --exclude=/proc"...
I've got a Digital Ocean droplet running FreeBSD which I shell into.
I can locate tcsh under /bin/tcsh but using setenv in my local .cshrc file doesn't cause this shell to be used on next login.
Env reports the shell as sh and the prompt hasn't changed to >
Editing master.passwd to use tcsh...
I like the way how tcsh works, but it is outdated a little bit (only 1 update since 2012), also some nice features are available in zsh, like suggesting flags and other completions for cli and not only cli apps… But some of its features are distracting and annoying IMHO. I didn't find any...
Hello, I have that sh script:
#!/bin/sh
DATE=`date +%Y-%m-%d:%H:%M:%S`
NAME="game"
if ps ax | grep -v grep | grep $NAME > /dev/null
then
echo "$NAME service running, everything is fine"
else
echo "$DATE: Restarting $NAME" >> /root/log
cd /usr/home/game/db && ./game
fi
and it works...
This is probably a noob question, but I have wondered for some time the difference between TTY and terminal like rxvt-unicode or Xterm (and less shell). Is TTY just a virtual device which runs terminal emulator like rxvt-unicode which runs shell like sh or bash?
If I have a freshly installed...
Hello,
we are using net/ssh in Ruby to execute scripts on a FreeBSD machine, in order to do some checks for Nagios. Actually it is a brand new Pfsense applicance.
The code is roughly the following:
Net::SSH.start(@host, @user, {:password=>@pass}) do |ssh|
erg=ssh.exec! "ls -al"
p erg
end...
Hello,
I admit, I am not proficient with regex. I'm trying to match a pattern taken from the output of reformime. (see below). I am not having much luck. When I can get it to work, then it matches everything. I think this is due to the working pattern matching the longer pattern.
Sample...
I need to learn shell scripting before programming so I bought some used books.
Are these any good? Most from early 2000's but i doubt much has changed.
Mastering Unix Shell Scripting
Beginning Shell Scripting
Beginning Portable Shell Scripting
Shell Scripting Recipes
I bought a C book...
Hi,
I'm a student and I have to create a script, but I want to show a progress bar when the script is making a backup. For example, I'm making a full backup of the FreeBSD system and while the script is making the job, I want to show a progress or a bar percent completed, is that possible on...
Hello,
when calling the gpg command I want gpg2 to be executed instead of gpg1. Both programs are installed. In Linux I used update-alternatives for that. What would be the equivalent in FreeBSD?
Thank you.
On pfSense 2.2.4 (FreeBSD 10.1), my custom init script filebeat_wrapper won't start at boot.
According to rcorder it should start right after boot:
# rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
(snip)
/etc/rc.d/SERVERS
/etc/rc.d/DAEMON
/etc/rc.d/LOGIN
/usr/local/etc/rc.d/filebeat_wrapper
(snip)...
I am on
FreeBSD 10.2-RELEASE-p14 FreeBSD 10.2-RELEASE-p14 #0: Wed Mar 16 20:46:12 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Installed vim through pkg install vim.
My Current shell is:
$ echo $SHELL
/usr/local/bin/bash
My .profile file is edited...
hi
I'm dabbling with shell scripting a little and trying to get a backup script running on FreeBSD.
#!/bin/csh
NOW=$(date +"%Y-%m-%d-%H%M")
FILE="example.com.$NOW.tar"
BACKUP_DIR="/usr/home/andy/backups"
WWW_DIR="/var/www/"
DB_USER="user"
DB_PASS="pass"
DB_NAME="dbname"...
Hi,
I'm an intermediate-level user of FreeBSD. I recently ran into a problem that I have been unable to solve. Basically, most (but not all) commands now return 'Command not found', even if I use the full path, which makes no sense to me whatsoever. The only thing I can think of that...
I decieded to start this thread after reading the thread 'Which shell do you use?'.
I'll start, mine is below.
# .cshrc - csh resource script, read at beginning of execution by each shell
#
#
# -- Set up command aliases
alias searchports 'find /usr/ports -type f -name pkg-descr | xargs...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.