Mobile app version of vmapp.org
Login or Join
Ann8826881

: 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

@Ann8826881

Posted in: #WebHosting

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Ann8826881

1 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme