When a WebSphere Liberty server is started on Linux, is its pid stored anywhere on the filesystem, in a .pid file or similar? I'm developing an automated script that under some scenarios, when the server won't cleanly stop, needs to force-kill it.
Andrew Ferrier's questions
I often use rsync
on a OSX-based laptop to synchronise some files from it to a Linux server. The laptop can be connected to different networks with greatly varying bandwidths (office ethernet, wifi, 3G, etc.) The --bwlimit=Kbps
option allows one to control the bandwidth used in userspace by specifying a hard (well, approximately hard) limit to rsync itself. However, it's expressed in Kbps, which makes it difficult for use in automated scripts that get used on varying networks, such as the ones the laptop connects to.
Is there a way to tell rsync to use a percentage of the bandwidth rather than a limit expressed in K? Alternatively, can I easily calculate this value dynamically or wrap rsync with a script to do it?
I'd like a solution that works on OS X, or failing that Linux - ideally both.
Note: I'd like to avoid solutions that involve hardcore traffic shaping with a firewall or such. Approximate or estimated values for the limit are OK.
I'm trying to exclude a directory tree as part of an rsync
command embedded in a bash
script approximately like this:
$OPTIONS="-rl --exclude 'Some Parent Directory/Another Directory'"
rsync $OPTIONS $SOURCEDIR [email protected]:/SomeTargetDir
My aim is to sync all of $SOURCEDIR
into /SomeTargetDir
on the target machine, with the exception of everything under Some Parent Directory/Another Directory
. However, I keep seeing errors of this form:
rsync: link_stat "/Users/myusername/Parent\" failed: No such file or directory (2)
I assume this is related to escaping the exclude path, but I just can't seem to get it right: every combination of \\
, \
and so on that I try doesn't seem right. How can I write the exclude rule correctly?
I don't want to use --exclude-from
unless I absolutely have to.
I am using rsync version 3.0.9 on OS X 10.8, syncing to Ubuntu 12.04 over SSH.
I'm currently running rsnapshot on host1, backing up some files from host2 using the inbuilt SFTP support (I have daily, weekly, and monthly backups running in a standard rsnapshot configuration). Both hosts are running Ubuntu and use LVM. Is there any straightforward way I can create and mount LVM snapshots on host2 to back up from, before a backup run is started, and delete them afterward, to increase the consistency of the set of files that are backed up? It looks like more recent versions of rsnapshot have LVM support built in using the linux_lvm_*
commands, but that only seems to work when backing up from the same host, which I'm not doing. Ideally the mechanism ought to be fairly failure redundant, i.e.:
- The LVM snapshots on host2 should be deleted after the backup is completed, whether it was successful or not.
- If a snapshot cannot be created, the backup doesn't proceed.
On Ubuntu 10.04, I have a USB 3G dongle which presents itself initially as a USB Mass Storage device with Windows drivers. usb_modeswitch can be used to get it to present itself as a modem, but the mass storage device still auto-mounts itself every time I plug it in as well. This is just an irritation/ugliness, not a serious problem, but I'm wondering if it's possible to write a udev rule to stop the device mounting, by filesystem name/UUID? I searched around, but couldn't find an example of such a rule.
I am using LVM on Ubuntu 9.10 (Karmic). I have a single LVM physical volume (and a single volume group).
I have an ext3 filesystem inside an LVM logical volume which I no longer use, but for the time being I would like not to delete it. I'm trying to figure out how to minimise the space it takes up inside my PV. resize2fs has the -M option which works well at resizing the filesystem to have zero free space, but of course this doesn't affect the logical volume. Most of the recipes on the web for shrinking ext3 inside an LV (e.g. this one), follow this basic pattern to alleviate problems with inaccurate calculations of filesystem boundaries, etc.:
- Shrink ext3 more than you quite want with resize2fs
- Shrink the LV to the exact size you want
- Re-run resize2fs to grow the filesystem slightly to efficiently use the complete LV.
That doesn't fully solve the problem in my case, because I want the LV size to be driven by the filesystem, rather than the other way round.
Is there a command or commands I can run to do this? Alternatively, it is possible for me to do the calculation of the filesystem size to give to lvresize with some degree of confidence?
Without thinking, I made a partimage image of a ~1TB ext3 partition, which only actually contained about 2GB of data, so gzipped down to that size. I then wiped it and used it for something else.
I'd now like to delete the partimage partition, but just want to double-check what it contains before I do so. However, I don't have 1TB of spare space to work in and restore it to, and partimage itself insists on this. Is there any way to shrink the partition inside the partimage image without unzipping? Alternatively, is there a way to mount it or see what's inside?
Thanks.