Tag Archives: Linux

rsync status with lsof

To see the status from rsync, you can use lsof:

lsof -ad3-999 -c rsync

Output:

COMMAND  PID USER   FD   TYPE             DEVICE SIZE/OFF       NODE NAME
rsync   8097 root    3r   REG             252,17   404832 7559983121 /srv/data/safematix
rsync   8097 root    4u  unix 0xffff8806f4447080      0t0      85225 type=STREAM
rsync   8097 root    5u  unix 0xffff8806f4444ec0      0t0      85226 type=STREAM
rsync   8098 root    3u  unix 0xffff880738502580      0t0      77431 type=STREAM
rsync   8099 root    4u  unix 0xffff880738500b40      0t0      77432 type=STREAM

ls date format

ls date format

I like ls, but there are a few things that alway bothered me. The data format…. There is a small remedy. 🙂

ls -lah

-rwxrwxrwx 1 1004 1004  115K Nov 21  2008 999_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9992_0
-rwxrwxrwx 1 1004 1004   55K Apr 23  2010 9992_1
-rwxrwxrwx 1 1004 1004  117K Apr 23  2010 9992_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9993_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9993_1
-rwxrwxrwx 1 1004 1004  109K Apr 23  2010 9993_2
-rwxrwxrwx 1 1004 1004  1.3M Apr 23  2010 9994_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9994_1
-rwxrwxrwx 1 1004 1004  109K Apr 23  2010 9994_2
-rwxrwxrwx 1 1004 1004  904K Apr 23  2010 9995_0
-rwxrwxrwx 1 1004 1004   53K Apr 23  2010 9995_1
-rwxrwxrwx 1 1004 1004  110K Apr 23  2010 9995_2
-rwxrwxrwx 1 1004 1004  745K Apr 23  2010 9996_0
-rwxrwxrwx 1 1004 1004   50K Apr 23  2010 9996_1
-rwxrwxrwx 1 1004 1004  103K Apr 23  2010 9996_2
-rwxrwxrwx 1 1004 1004  1.1M Apr 23  2010 9997_0

ls -lah –time-style=long-iso

-rwxrwxrwx 1 1004 1004  115K 2008-11-21 19:34 999_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9992_0
-rwxrwxrwx 1 1004 1004   55K 2010-04-23 10:12 9992_1
-rwxrwxrwx 1 1004 1004  117K 2010-04-23 10:12 9992_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9993_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:12 9993_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:12 9993_2
-rwxrwxrwx 1 1004 1004  1.3M 2010-04-23 10:13 9994_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9994_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:13 9994_2
-rwxrwxrwx 1 1004 1004  904K 2010-04-23 10:13 9995_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9995_1
-rwxrwxrwx 1 1004 1004  110K 2010-04-23 10:13 9995_2
-rwxrwxrwx 1 1004 1004  745K 2010-04-23 10:13 9996_0
-rwxrwxrwx 1 1004 1004   50K 2010-04-23 10:13 9996_1
-rwxrwxrwx 1 1004 1004  103K 2010-04-23 10:13 9996_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:13 9997_0
%a     locale's abbreviated weekday name (e.g., Sun)
%A     locale's full weekday name (e.g., Sunday)
%b     locale's abbreviated month name (e.g., Jan)
%B     locale's full month name (e.g., January)
%c     locale's date and time (e.g., Thu Mar  3 23:05:25 2005)
%C     century; like %Y, except omit last two digits (e.g., 20)
%d     day of month (e.g., 01)
%F     full date; same as %Y-%m-%d
%H     hour (00..23)
%I     hour (01..12)
%m     month (01..12)
%M     minute (00..59)
%r     locale's 12-hour clock time (e.g., 11:11:04 PM)
%R     24-hour hour and minute; same as %H:%M
%s     seconds since 1970-01-01 00:00:00 UTC
%S     second (00..60)
%t     a tab
%T     time; same as %H:%M:%S
%x     locale's date representation (e.g., 12/31/99)
%X     locale's time representation (e.g., 23:13:48)
%y     last two digits of year (00..99)
%Y     year

ls -lah –time-style=+%F\ %H:%M

-rwxrwxrwx 1 1004 1004  115K 2008-11-21 19:34 999_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9992_0
-rwxrwxrwx 1 1004 1004   55K 2010-04-23 10:12 9992_1
-rwxrwxrwx 1 1004 1004  117K 2010-04-23 10:12 9992_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:12 9993_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:12 9993_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:12 9993_2
-rwxrwxrwx 1 1004 1004  1.3M 2010-04-23 10:13 9994_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9994_1
-rwxrwxrwx 1 1004 1004  109K 2010-04-23 10:13 9994_2
-rwxrwxrwx 1 1004 1004  904K 2010-04-23 10:13 9995_0
-rwxrwxrwx 1 1004 1004   53K 2010-04-23 10:13 9995_1
-rwxrwxrwx 1 1004 1004  110K 2010-04-23 10:13 9995_2
-rwxrwxrwx 1 1004 1004  745K 2010-04-23 10:13 9996_0
-rwxrwxrwx 1 1004 1004   50K 2010-04-23 10:13 9996_1
-rwxrwxrwx 1 1004 1004  103K 2010-04-23 10:13 9996_2
-rwxrwxrwx 1 1004 1004  1.1M 2010-04-23 10:13 9997_0