perl×Ô¶¯ftpµÄ·½·¨£¨Linux°æ±¾,Net::FTP£©
--ÕâÀïËùÓеÄperl¼¼ÊõÎÊÌⶼÊÇÎÒƽ³£´¦ÀíÊý¾ÝµÄʱºòÒªÓõ½µÄ£¬¿ÉÄܲ»ÊǺÜÇ¿µÄ³ÌÐò£¬µ«ÊÇÏ£ÍûÄܺÍÈÈ°®perlµÄͬ־£¬Ò»Æð·ÖÏí...
ÔںܶàÇé¿öÏ£¬ÎÒÃÇÐèÒª´ÓÔ¶´¦·þÎñÆ÷ÉÏÏÂÔص±Ìì»òÕß×òÌìÉú³ÉµÄÈÕÖ¾Îļþ£¬À´²é¿´Ò»Ð©ÎÒÃÇÐèÒªµÄ¶«Î÷»òÕß±¸·Ý¡£
Èç¹û²ÉÓÃÁËftp£¬ÄÇôÎÒÃÇÓ¦¸Ã½¨Á¢×Ô¶¯»¯µÄftp·½Ê½£¬À´·½±ãÎÒÃǵŤ×÷£¬ÏÂÃæÎÒÃǽ«Ê¹ÓÃperlÓïÑÔ±àдµÄ£¬µ±È»Ò²¿ÉÒÔÓÃshell¡£
ÀûÓÃÁËperlµÄÄ£¿é£ºNet::FTP¡£
#!/usr/bin/perl
use Net::FTP;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime();
$year=$year+1900; #ÏÔʾΪµ±Ç°Äê·Ý
$mon=$mon+1; #ÏÔʾΪµ±Ç°Ô·Ý
$mon = "0".$mon if ($mon < 10); #ÏÔʾÔ·ÝΪ 01,02µÄ¸ñʽ
$sum="$year-$mon-$mday"; #ÏÔʾʱ¼ä Ϊ 2008-12-22 ÕâÑùµÄ¸ñʽ
$ftp = Net::FTP->new("hostname(IPµØÖ·)", Debug =>1);
$ftp->login('user(Óû§Ãû)','passwd(ÃÜÂë)');
$ftp->binary;
$ftp->cwd("path(·¾¶)");
$ftp->get("$sum-filename(ÎļþÃû)") #±ÈÈç 2008-12-22_text.txt
or die "$!";
$ftp->quit;
±£´æºó¡£¸øÎļþ¼ÓÉÏÖ´ÐС£ÀûÓà chmodÃüÁî¡£(ÎÒÃÇÔÝʱ°ÑÖ´ÐÐÎļþ½Ð×ö Ftp.pl)
ÔÚÀ´ÉèÖÃÀýÐÐÐÔÃüÁî ÀûÓÃcrontabÃüÁî¡£
±ÈÈç ÄãÏëÔçÉÏ5µã°ë¿ªÊ¼Ö´ÐÐÏÂÔØ¡£Ôò¼ÓÈë
30 05 * * * perl Ftp.pl
±£´æ¡£Ôò³ÌÐò¾Í¿ªÊ¼×Ô¶¯»¯ftpÁË¡£
Ïà¹ØÎĵµ£º
#include <stdio.h>
#include <unistd.h>
#define FOO "foo"
int main(void)
{
if(!access(FOO, F_OK))
{
if(!unlink(FOO))
{
}
else
{
printf("remove %s failed\n", FOO);
}
}
else
{
printf("%s not existed\ ......
Linux ÏÂÃæʹÓÃRPCÐèҪʹÓõ½ÃüÁîrpcgen.
ÔÚLinuxÏ¿ª·¢RPC³ÌÐòÁ÷³ÌÈçÏ£º
1.дһ¸örpc³ÌÐò£¬
Èçtest.x
2.ʹÓÃrpcgenÉú³É±ØÐëµÄÎļþ£¬Í¨³£ÊÇ¿Í»§¶ËºÍ·þÎñÆ÷¶ËÒÔ¼°Í·Îļþ
$rpcgen test.x
3.ʹÓÃrpcgenÉú³É·þÎñÆ÷¶ËºÍ¿Í»§¶ËµÄCÓïÑÔ´úÂë
&n ......
1. ·þÎñÆ÷nfsµÄÅäÖÃ
2. ¿Í»§¶ËnfsµÄÅäÖÃ
3. ʹÓÃnfs
3.1 ×÷Ϊ¹²ÏíÎļþϵͳmount
3.2 ×÷Ϊ¸ùÎļþϵͳmount
4.±¸ ×¢
nfsÊÇNetwork File System£¬»ùÓÚRPC(Remote Procedure Call ProtocolÔ¶³Ì¹ý³Ìµ ......
Á¬½ÓÉÏÁË·þÎñÆ÷£¬¼ì²éһϡ£´ÅÅ̿ռ䲻¹»ÁË
[java@localhost ~]$ df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 5.8G 5.8G 0M 100% /
/dev/hda1 99M 8.5M 86M 10% /boot
none 506M 0 506M 0% /dev/shm
/dev/hda6 20G 77M 19G 1% /tmp
/dev/hda5 20G 14G 5.2G 72% /usr/local
/dev/hd ......
µã»÷²Ëµ¥“ÐéÄâ»ú”--Install VMware Tools
ÔÚred hat×ÀÃæÓÒ»÷konsole
ÊäÈëÃüÁcd/media
ls
ÒªÏÈË«»÷VMware ToolsÔÙÊäÈëÃüÁîÖ±µ½³öÏÖVMware Toolsi
ÔÙÊäÈëÃüÁcd VM*
&nb ......