Uh, yeah. A friend of mine is looking for a program that can automatically take files from a list, and put them in an alternate location, from another list. Anyone know a program that can do this, or is willing to write one?
Why do you need a list for the destination? Or do you want to rename the files as well as move them?
Basically what the program is supposed to do is copy a file from a destination like C:\My Documents\Pics\Pic.bmp to another folder on a different computer that is networked with the source destination. Kind of need the ability to make a list of source locations and destination locations and a way to tell it what time to start this activity too please. Think it's possible?
(Its for him =p)
Write a script
#!/usr/bin/perl
# This is off-the-cuff, but it should do what you want. No warranties, of course.
# This program is not suitable for any purpose at all. Back up your entire house before using.
# User assumes all responsibility for installing perl and for any damage caused by the use, misuse, or incompetent use, of this program.
while (<>) {
chomp;
($l, $r) = split;
rename $l, $r;
}
I dunno, the easier way might be:
scp `cat sourcefiles` destip:destdirectory
Example:
Quoteiago@Slayer:~/tmp$ touch test1 test2 testc
iago@Slayer:~$ cat > files
test1
test2
testc
iago@Slayer:~/tmp$ scp `cat files` 24.76.173.61:/tmp
[email protected]'s password:
test1 100% 0 0.0KB/s 00:00
test2 100% 0 0.0KB/s 00:00
testc 100% 0 0.0KB/s 00:00
iago@Slayer:~/tmp$
Quote from: iago on October 04, 2005, 11:11 PMI dunno, the easier way might be:
scp `cat sourcefiles` destip:destdirectory
True, but that doesn't permit per-file renames, and it'll require several extra utilities to work on an MS-Windows system. My method only requires perl. Yours requires scp, cat, and a shell smart enough to process backticks. :)
Quote from: Kp on October 04, 2005, 11:39 PM
Quote from: iago on October 04, 2005, 11:11 PMI dunno, the easier way might be:
scp `cat sourcefiles` destip:destdirectory
True, but that doesn't permit per-file renames, and it'll require several extra utilities to work on an MS-Windows system. My method only requires perl. Yours requires scp, cat, and a shell smart enough to process backticks. :)
Well, I was going to use a "for i in..." which would support renaming with a simple "cut" or something, but that would require you to input your password for every file :)
Hes in Windows =p
omg.....batch
copy %%a, %%b
Done.
Hm, come to think about it, he could just map the drive hes backing up to as Z:.
I'm still lost as to what you guys are trying to do; all I'm getting out of this is the synchronization aspect, but I'm not exactly sure.
Charlie doesn't exactly have a stable system, yet he wants his files to stay safe.
Quote from: Kp on October 04, 2005, 11:39 PM
My method only requires perl. Yours requires scp, cat, and a shell smart enough to process backticks. :)
Kp's method, then, is the one with heavier requirements, isn't it?
1) Map your backup drive to Z:, or if that drive is taken, substitute another letter.
2) Create a new file with Notepad.exe called backup.bat and save it on your desktop (or anywhere else)
3) In this file, put the following batch code:
copy file newfile
for each file. Example:
copy C:\Windows\kernel32.exe Z:\Backup\Windows\Kernel32.exe
copy C:\Documents and Settings\Joe\Pornography\* Z:\Backup\Documents and Settings\Joe\Pornography
4) To back up your files, just double click the script.
Ok, how about the easy way: Why doesn't he set up an FTP server? FileZilla seems like a good one.