: Set up non-index.html home page to change daily I have a shell account on a remote server that provides basic Web hosting. (It's a NetBSD host mainly for developer/sysadmin gurus.) I am only
I have a shell account on a remote server that provides basic Web hosting. (It's a NetBSD host mainly for developer/sysadmin gurus.) I am only a user with no super-user privileges. I want to upload a new static Webpage every day to be the homepage and I don't want it to be index.html, rather, something like 20170108.html, a file name that will change everyday with each new static page upload. I realize I could just upload and rename <today's date>.html to index.html, but is there a less kludged way?
More posts by @Ann8826881
1 Comments
Sorted by latest first Latest Oldest Best
As you have access to ssh, just copy your file replacing the server's index.html file scp <localfile.html> <remoteuser>@<remoteserver>:<remote-path>/index.html for example:
scp 20170108.html webuser@myserver.com:/var/www/index.html
You can place that in a shell script take a file as the first parameter, for example script.sh:
#!/bin/bash
scp webuser@myserver.com:/var/www/index.html
Then you can make a script to take file with the current day as the first parameter to the server
$ ./script.sh `date +%Y%m%d`.html
would execute
$ scp 20170108.html webuser@myserver.com:/var/www/index.html
Putting that in a cronjob should be trivial.
You can use Tramp mode to copy the files from Emacs itself.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.