Ubuntu Technical

Ubuntu technical problems and solutions reference, a modern cookbook.

Monthly Archives: March 2012

Stop or start BOINC daemon after boot

I have installed BOINC client, to subscribe to some projects meant to discovery alien life or at least some new pulsars.
However, I have noticed that the client, in contrast to it’s Windows counterpart, didn’t have an option in Preferences for auto-start on system boot. Of course it was starting up automatically and that’s not good in my book. So I started digging a little bit, and came across the documentation page

In a nutshell, the “init” script is:

/etc/init.d/boinc-client 

The following commands (with self-explanatory options) can be directly run on the script:

./etc/init.d/boinc-client start
./etc/init.d/boinc-client stop
./etc/init.d/boinc-client restart
./etc/init.d/boinc-client status

As I have now found out, in a Debian-based Linux distributions you use the update-rc.d command to turn a system service (daemon) on or off at boot time (I needed to use the -f force option to remove boinc-client, don’t know exactly why):

# tells the system to start the BOINC client as a daemon at boot time
sudo update-rc.d boinc-client defaults 98
# tells the system not to start the BOINC client at boot time
sudo update-rc.d -f boinc-client remove

Cheers



Flattr this

Advertisements

Sync directories excluding file types

I have recently needed to find a solution to moving the content of a directory from one folder into another, but excluding certain file types. After digging through the documentation I have found the rsync command.
Short extract from it’s man pages:

Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.

So, here is the script to copy files from one place to another ignoring certain file types (in this example I exclude .avi files):

rsync /source/folder -av --exclude='*.avi' /destination/folder

The -v option is for verbose, so that we can see in the output what’s being synced.
Enjoy.



Flattr this

%d bloggers like this: