Code:
#date +%b%Y Jun2015
If I want to show the last month and year ( as current month is Jun2015, I would like display May2015 , if current is Jan2016 , then display Dec2015 ) , would advise what can I do ? thanks
#date +%b%Y Jun2015
/************************************************************ * * Project 4: How Old Are You Really? * * Author: xx * Date: 6 May 2015 * * This is a program designed to calculates the difference * between two dates, which will be expressed in terms of * years, months and days. * ***********************************************************/ #include <bjarne/std_lib_facilities.h> struct Date { int month; int day; int year; // Member functions Date get_date(); Date get_birth_date(); bool is_valid_date(int year, int month, int day); bool is_before(Date& date1, Date& date2); Date calculate_age(Date& date1,Date& date2); }; // Declaration Date get_date(); Date get_birth_date(); bool is_valid_date(int year, int month, int day); bool is_before(Date& date1, Date& date2); Date calculate_age(Date& date1,Date& date2); int main() { Date date1 = get_date(); Date date2 = get_birth_date(); Date get_date(); // Check if the date is correct if (! is_valid_date(year, month, day)) error("Date is not valid."); // Run how old or not? char go_on; cout << "Would you like to see how old you are (y/n)?\n"; cin >> go_on; if (go_on=='n'){ cout << "You are so chicken!"; return 0;} else if (go_on!='y') error("Please enter y for yes or n for no."); Date get_birth_date(); // Is birthday valid as well? if (! is_valid_date(int year, int month, int day)) error("Date is not valid."); // Is the birthday before 'today'? if (!(is_before(Date& date1, Date& date2))) error("Your birthday should not be later than today, terminator."); // Calculate and give the answer. Date calculate_age(); } Date get_date() { Date date1; cout << "Welcome to the age calculator!\n"; cout << "Please enter today's date (mm/dd/yyyy): "; int m; int d; int y; // To ignore the '/' during reading char slash; cin >> m; date1.month = m; cin >> slash; cin >> d; date1.day = d; cin >> slash; cin >> y; date1.year = y; cout << "Date entered was "<< date1.month << "/" << date1.day << "/" << date1.year <<"\n"; } Date get_birth_date() { Date date2; cout << "Please enter your birth date (mm/dd/yyyy): "; int m; int d; int y; // To ignore the '/' during reading char slash; cin >> m; date2.month = m; cin >> slash; cin >> d; date2.day = d; cin >> slash; cin >> y; date2.year = y; cout << "Your birthday is "<< date2.month << "/" << date2.day << "/" << date2.year <<"\n"; } // Is date valid? bool is_vaild_date(int year, int month, int day) { if (day<0) return false; if (month<1 || month>12) return false; // Check if the date exists or not considering there are have // different days when month varies int days_in_month=31; switch (month){ case 2: days_in_month=28; break; case 4: case 6: case 9: case 11: days_in_month=30; break; } if (days_in_month<day) return false; return true; } //Date check - is birthday before 'today'? bool is_before(Date& date1, Date& date2) { if (Date& date1.year<Date& date2.year) return false; else if (Date& date1.month<Date& date2.month) return false; else if (Date& date1.day< Date& date2.day) return false; return true; } // Calculation Date calculate_age(Date& date1,Date& date2) { Date date3; date3.day = date1.day - date2.day; date3.month = date1.month - date2.month; date3.year = date1.year - date2.month; if (date3.day<0){ date3.day = 30 + date3.day; date3.month = date3.month - 1; } if (date3.month<0){ date3.month = 12 + date3.day; date3.year = date3.year - 1; } cout <<"You are " << date3.year <<" years, "<< date3.month <<" months, and " << date3.day <<" days old.\n"; }
http://192.168.0.1/awstats/awstats.pl?config=mydomain.com ,
Not Found The requested URL /awstats/awstats.pl was not found on this server.
# Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command */10 * * * * /usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav
/usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav
*/10 * * * * /usr/bin/arecord -t wav -f cd -d 42 /home/randy/Music/lanting$(date "+\%^b\%d\%y").wav