FTP server

I am using vsftpd as ftp server

apt-get install vsftpd

Be sure to open the aprorpiate ports in shorewall to access the ftp server.

Backup

I a create with a cronjob lvm snapshots and write tgz files of these snapshots. To create incremental backups I use the mtime with find. All this is accumulated inside the lvbackup script which is one of my software projects. The backups are written to ${backup_dir} and rsynced with an other server of mine ${backup_server} (you have to share the ssh keys to do that). The corresponding lines in /etc/crontab looks as follows

# delete old files create backup and sync with mortar
0  0    * * *   root    find ${backup_dir} -mtime +7 -not -wholename "${backup_dir}/persistent*" -delete &> /dev/null
15 0    * * *   root    /usr/local/bin/lvbackup -b
0  1    * * *   root    rsync -raz --delete --progress ${backup_dir} ${backup_server}:/daten/daten/backup/herkules

Git daemon

I prefer to provide a git-daemon service to deliver my git repositories read only. There is a really good documentation to the topic of providing git access. This is easy and fast.

apt-get install git-daemon-run

git-daemon-run does not use classical /etc/init.d/* scripts but is based on runit/runsv. That means we configure the deamon with the file /etc/sv/git-daemon/run which might contain something like

#!/bin/sh
exec 2>&1
echo 'git-daemon starting.'
exec chpst -ugitdaemon \
  "$(git --exec-path)"/git-daemon --verbose --enable=upload-pack --enable=upload-archive --base-path=${git_base} ${git_base}

You have to insert your repository base directory for ${git_base}. Finally you can control the service with

sv restart git-daemon

Check the log file in /var/log/git-daemon/current and modify the shorewall rules to contain

ACCEPT                  net             $FW             tcp     9418  # git-server

If you want to export a repository you have to touch a file git-daemon-export-ok inside the repo.

<- Previous | Home