Archives for posts tagged ‘solaris’

crontab/date: timestamp in log file name

A cronjob shall run a script and write it’s output to a new logfile every day. Easy, right?
0 2 * * * echo test > test.`date +%Y-%m-%d`

This will create a file called “test.“, that will be overwritten every day …and here is why (from man crontab):
“Percent-signs (%) in the command, unless escaped with backslash (\), [...]

Solaris/bash: “no: command not found”

At work we have a script, that rsyncs a bunch of files from one server to the other, nothing special. The script works perfectly when run manually from a shell, but does not when run via crontab. The error message does not really point to anything:
no: command not found
What is the “no” command and why [...]

Python: Building MySQL-python 1.2.3c1 on Solaris 10 with MySQL 5.1.42

Trying to build MySQL-python from source on Solaris 10 when using MySQL 5.1.42 (pkg from mysql.com) may fail with something like this:
gcc -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,’gamma’,1) -D__version__=1.2.3c1 -I/opt/mysql/mysql/include -I/opt/alcatel/logger/include/python2.6 -c _mysql.c -o build/temp.solaris-2.10-sun4u-2.6/_mysql.o -g -mt -m32 -xarch=sparc -DHAVE_RWLOCK_T -DUNIV_SOLARIS -DUNIV_SOLARIS
gcc: warning: `-x arch=sparc’ after last input file has no effect
cc1: [...]