Commit Diff
Diff:
e5de9347f708792a7ea7b293f3539b3ae34268d8
6941c9c13d739183241826b5c924ef1608b73c3e
Commit:
6941c9c13d739183241826b5c924ef1608b73c3e
Tree:
5c37fc8d749d7b54dd9e9d3d9b5aec08440873be
Author:
jrmu <jrmu@ircnow.org>
Committer:
jrmu <jrmu@ircnow.org>
Date:
Tue Mar 7 15:50:57 2023 UTC
Message:
Make writes safer with backups
blob - d5722b6ec40404ce17a8e4a369b0bb6935abe7e6
blob + c725f59d1bba9b37ce95de1a763f46af50265a38
--- botnow
+++ botnow
@@ -39,7 +39,7 @@ sub readstr {
sub writefile {
my ($filename, $str) = @_;
my $date = date();
- copy($filename, "/home/botnow/".basename($filename).date()) or die "Could not make backup of $filename";
+ copy($filename, $homepath.basename($filename).".".date()) or die "Could not make backup of $filename";
open(my $fh, '>', "$filename") or die "Could not write to $filename";
print $fh $str;
close $fh;
IRCNow