Thank you for suggestions. But rsync is not my solution. I want to be able to delete all the files in the $DST folder but yet not have files copy over again, even if the $DST is empty and the $SRC is full. Bottom line, if the files that are "currently" in $SRC have already been copied once over to $DST, then the don't copy again (unless I intentionally restart be deleting the MD5 list).
I was ponder this code last night too and I realized that it's just parsing a filename in an MD5 list. It's almost like I need to do something like this...
Unfortunately, I'm not where I can test this right now, but does that seem like it would work?
---------- Post updated at 10:34 AM ---------- Previous update was at 09:39 AM ----------
OK... I had a moment to test a script and this is what happened.
Here are the two directories I'm working with as a sample:
Here is my code:
Here is the output:
Anyone tell me where I went wrong?
Hi
how do u make "copy" of o level dump taken via ufsdumo in solaris?
To elaborate, imagine you have taken a 0 level dump via the following command
ufsdump 0ulf /dev/rmt/1n /
and then again execute the same command to take a second 0 level dump
Now take an incremental dump
ufsdump 1ulf... (2 Replies)
Hello,
I would like to run md5sum on a list of files saved in a text file, and save the result in another file. (ie. md5sum `cat list.txt` > md5list.txt)
I have tried several things, but I am always confronted to the same problem: some of the filenames have spaces.
I have run sed on the... (5 Replies)
We are trying to make duplicates of some Magneto Optical Disks that were created in Irix 6.5. The disks are 2.3 gig and the using a scsi MOD drive. Is there possbily a disk copy like in dos or some simple script to do this - any help appreciated.
Thanks (0 Replies)
When script is running you only see when some of the commands are not successfull.
Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Hi,
I currently have a shell script that takes an RPM and scp's it to a set of remote servers and installs it.
What I would like to be able to do is make the script get the md5sum of the RPM locally (so get the md5sum of the rpm from where im running the script) and then scp the rpm to the... (0 Replies)
Ok so I wrote a php script that outputs the below to users on a webpage.
# Download: /home/content/d/i/v/divine1234/eBookDownloads/ScalpRemedy_jablaa12734.zip
the php code that outputs the above is:
echo ("<li>Download: $download_link</li>\n");
The thing is, I dont want... (1 Reply)
Hello,
I need to download multiple files from an FTP server but occasionally they arrive in error so I need to perform an integrity check. I've been attempting to write a bash script that does the following:
Downloads all files including those in sub directories
Perform md5sum using... (4 Replies)
And not to start. I can compare files, that's easy. The problem is that I compare files in a directory, and check if these files exist in another directory. The problem is that the file names are not the same. So I have to compare with "md5sum" or something similar. How I can do?
All this in... (7 Replies)
Hi All,
I have a text file (code_data.txt) with the followig data.
AMAR AB123456 XYZ
KIRAN CB789 ABC
RAJ CS78890 XYZ
KAMESH A33535335 ABC
KUMAR MD678894 MAT
RITESH SR3535355... (26 Replies)
I am getting No such file or directory if my variable contains white spaces... Is there a way to fix this?
This works
x="1.md5"
md5sum -c "$x"
This, does not
x="23\ 5\ 6\ 7\ 8\ 9\ 10.md5"
md5sum -c "$x"
md5sum: '23\ 5\ 6\ 7\ 8\ 9\ 10.md5': No such file or directory
How do I fix... (1 Reply)
Discussion started by: soichiro
1 Replies
LEARN ABOUT DEBIAN
poe::component::irc::cookbook::seen
POE::Component::IRC::Cookbook::Seen(3pm) User Contributed Perl Documentation POE::Component::IRC::Cookbook::Seen(3pm)NAME
POE::Component::IRC::Cookbook::Seen - Implement the 'seen' command
SYNOPSIS
This little bot tracks the whereabouts of users and allows you to retrieve that information on command.
19:59:51 * seen_bot (n=hinrik@pool-71-164-43-32.chrlwv.east.verizon.net) has joined #test_channel1
19:59:55 <foo> bar
20:00:16 * seen_bot has quit (Remote closed the connection)
20:00:27 * seen_bot (n=hinrik@pool-71-164-43-32.chrlwv.east.verizon.net) has joined #test_channel1
20:00:29 <literal> seen_bot: seen seen_bot
20:00:29 <seen_bot> literal: I last saw seen_bot at Mon Sep 22 20:00:27 2008 joining #test_channel1
20:00:34 <literal> seen_bot: seen foo
20:00:40 <seen_bot> literal: I last saw foo at Mon Sep 22 19:59:56 2008 on #test_channel1 saying: bar
20:00:45 <literal> seen_bot: seen baz
20:00:48 <seen_bot> literal: I haven't seen baz
DESCRIPTION
#!/usr/bin/env perl
use strict;
use warnings;
use IRC::Utils qw(parse_user lc_irc);
use POE;
use POE::Component::IRC::State;
use POE::Component::IRC::Plugin::AutoJoin;
use POE::Component::IRC::Plugin::BotCommand;
use Storable;
use constant {
USER_DATE => 0,
USER_MSG => 1,
DATA_FILE => 'seen',
SAVE_INTERVAL => 20 * 60, # save state every 20 mins
};
my $seen = { };
$seen = retrieve(DATA_FILE) if -s DATA_FILE;
POE::Session->create(
package_states => [
main => [ qw(
_start
irc_botcmd_seen
irc_ctcp_action
irc_join
irc_part
irc_public
irc_quit
save
)]
],
);
$poe_kernel->run();
sub _start {
my ($kernel, $heap) = @_[KERNEL, HEAP];
my $irc = POE::Component::IRC::State->spawn(
Nick => 'seen_bot',
Server => 'irc.freenode.net',
);
$heap->{irc} = $irc;
$irc->plugin_add('AutoJoin', POE::Component::IRC::Plugin::AutoJoin->new(
Channels => [ '#test_channel1', '#test_channel2' ]
));
$irc->plugin_add('BotCommand', POE::Component::IRC::Plugin::BotCommand->new(
Commands => {
seen => 'Usage: seen <nick>'
}
));
$irc->yield(register => qw(ctcp_action join part public quit botcmd_seen));
$irc->yield('connect');
$kernel->delay_set('save', SAVE_INTERVAL);
return;
}
sub save {
my $kernel = $_[KERNEL];
warn "storing
";
store($seen, DATA_FILE) or die "Can't save state";
$kernel->delay_set('save', SAVE_INTERVAL);
}
sub irc_ctcp_action {
my $nick = parse_user($_[ARG0]);
my $chan = $_[ARG1]->[0];
my $text = $_[ARG2];
add_nick($nick, "on $chan doing: * $nick $text");
}
sub irc_join {
my $nick = parse_user($_[ARG0]);
my $chan = $_[ARG1];
add_nick($nick, "joining $chan");
}
sub irc_part {
my $nick = parse_user($_[ARG0]);
my $chan = $_[ARG1];
my $text = $_[ARG2];
my $msg = 'parting $chan';
$msg .= " with message '$text'" if defined $text;
add_nick($nick, $msg);
}
sub irc_public {
my $nick = parse_user($_[ARG0]);
my $chan = $_[ARG1]->[0];
my $text = $_[ARG2];
add_nick($nick, "on $chan saying: $text");
}
sub irc_quit {
my $nick = parse_user($_[ARG0]);
my $text = $_[ARG1];
my $msg = 'quitting';
$msg .= " with message '$text'" if defined $text;
add_nick($nick, $msg);
}
sub add_nick {
my ($nick, $msg) = @_;
$seen->{lc_irc($nick)} = [time, $msg];
}
sub irc_botcmd_seen {
my ($heap, $nick, $channel, $target) = @_[HEAP, ARG0..$#_];
$nick = parse_user($nick);
my $irc = $heap->{irc};
if ($seen->{lc_irc($target)}) {
my $date = localtime $seen->{lc_irc($target)}->[USER_DATE];
my $msg = $seen->{lc_irc($target)}->[USER_MSG];
$irc->yield(privmsg => $channel, "$nick: I last saw $target at $date $msg");
}
else {
$irc->yield(privmsg => $channel, "$nick: I haven't seen $target");
}
}
AUTHOR
Hinrik Oern Sigur`sson, hinrik.sig@gmail.com
perl v5.14.2 2011-12-07 POE::Component::IRC::Cookbook::Seen(3pm)