home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] Random Questions #25


  • Subject: [NMLUG] Random Questions #25
  • From: _sarang_ at sarangworld.com (Sarang)
  • Date: Fri Apr 23 19:03:39 2004

Pretend I have a clever opening line here,

% How can I test a command before putting it in my crontab file? [1]

% How can I get "rsync -a -e ssh root@remote:/dev/hda1 file.ufs" to work?
(ie, rsync a remote EXT2FS filesystem to a local file) [2]

% My keyboard almost freezes when rsync runs, how to fix? [3]

% Is there an emacs function to insert current date/time? [4]

[1] Cron runs w/ a different path/shell/permissions/etc than my regular
environment, so what works at my shell prompt may not work in cron.
Obvious workarounds I dislike: 1) running the command every minute in cron
(can be slow if you make a lot of mistakes, may have to wait up to a
minute for each error message), 2) using a Perl script (Perl scripts
usually work the same in cron and on the command line, but using Perl for
simple tasks is inelegant).

[2] Rsync complains /dev/hda1's not a "regular file". True, but does it
matter? Can't I tell rsync to just pretend it is? (I assume block files
that are really hard drives can be treated as regular files, no?). I
realize I could simply rsync the mount point for the device w/ the -X
(--one-file-system) option, but that's inelegant since rsync would handle
each file on the device separately. I could also tar/dd /dev/hda1 on the
remote machine and then rsync the result, but that requires a lot more
room on the remote system. The --devices option looks almost right, but I
want the local result to be a true file (like the result of mke2fs), not a
device.

[3] I run rsync from cron hourly (in a more normal way than in my previous
question <G>). It works fine, but my keyboard almost freezes while rsync
is running, EVEN IF I nice rsync to very low priority. "top" shows rsync
always takes up LOTS of CPU time, even when niced way down. Any way to fix
this? I tried upping the priority of ksoftirqd_CPU0 (which
process/receives keyboard events???) but that didn't help either. A silly
workaround is to UP the priority of rsync, so it runs faster (but slows
down the keyboard even more during the shorter time it's running).

[4] The temptingly-named "time-stamp" command does NOT do this, sadly.
Could I define/defun a function that spews the output of "date" (or
presumably any Unix command) to the current buffer? It's easy to write an
emacs function that RUNS the command "date" (or whatever), but I can't
figure out how to "redirect" the output to the current emacs buffer.

--
Sincerely, Sarang (sarang@sarangworld.com)
AOL Instant Messenger ID: JavaMath
Backup Email: saranghome@softhome.net
<html><img src='http://noproxy.sarangworld.com/EXP/rr.php?20040423.190102'></html>




Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache