Typo3update is designed to directly update content to a Typo3 website from the command line. It works as a network service and can be used from any machine that can connect to the server running the Typo3 website. For example, quota overviews and cluster news information that is available from command line programs or text files can be updated to Typo3 using simple bash scripts. Typo3update takes the actual content from standard input. Additionally, it requies two command line options: uid and the header.
Have a look at the following example:
$ cat textfile | typo3update 9533 "About"
This will insert the contents of textfile into content element 9533 that has the heading “About”. The heading parameter is to double check the content element id. If the id doesn’t match the supplied heading, typo3update refuses to update (overwrite) the content. Instead, it writes a line to an error log file.
The content element should be created first from the Typo3 backend. To identify the uid of the content element in a certain page, just hover your mouse pointer above the content element icon. The uid will show up in a tool-tip:

Typo3update works with a client and a server part. The typo3update-server runs as a (x)inetd service on the server that runs the Typo3 web page. This means that the server is started as soon as there is an incoming connection on a certain port, in this case port 60300. The server reads the lines that are sent by the clients. The first four lines are used as a kind of header, telling where the information should go and where it comes from. The rest of the lines is the actual content that should be updated to mysql database that is used by Typo3.
The client is a simple bash script:
#!/bin/sh # typo3update - updates the bodytext of a typo3 content element # by talking to the typo3update-server installed on the intranet # webserver # # Usage: # - first argument is the content element id # - second argument is the header # - content is taken from stdin # # example: # $ cat some_file | typo3update 9657 "my content element" exec 3<>/dev/tcp/intranet/60300 echo -e "$1\r" >&3 echo -e "$2\r" >&3 echo -e "$HOSTNAME\r" >&3 echo -e "$USER\r" >&3 cat - >&3
These are the steps to set it all up. First the server:
- Install the typo3update-server script. I’ve put it in /usr/local/bin. You can run it on the web-server, but since it uses mysql client, it can be on any machine. Make sure to download the script in stead of copy/past from the browser window. There are some ^M characters in it that need to be preserved. Configure the database variables so that it is able to connect to the Typo3 database.
- Configure xinetd. I used the following configuration:
$ cat /etc/xinetd.d/typo3update-server service typo3update-server { socket_type = stream protocol = tcp server = /usr/local/bin/typo3update-server user = root wait = no disable = no } - Add an entry to /etc/services:
$ grep typo3 /etc/services typo3update-server 60300/tcp # typo3 content update service
- Restart the xinetd service:
$ sudo /etc/init.d/xinetd restart
- Check /var/log/messages to see if xinetd liked the new server.
And on the client:
- Install typo3update on the client machine, for instance in /usr/local/bin.
- Configure typo3update to connect to the right machine.
- Test! Create a new content element in the Typo3 back end and write down the uid and the content header. This should now work:
$ ps | typo3update 7965 "My test content element"
Optionally, you can put the typo3update log on the web. It will give you an overview of all content elements that are updated in this fashion. Create a content element of type ‘table’ and create a cronjob like:
$ crontab -l | grep typo3 */10 * * * * tail -n 30 /var/log/typo3update-server.log | typo3update 56857 "Overview of content elements managed by typo3update"
You could do the same thing for the error log file.
Referenced articles: Socket Programming [troubleshooters.com], Socket programming with /dev/tcp [Dave's Blog].